x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

created child component does not moved with root component

I am creating a class in c++ for a base of a later used blueprint. Somehow if I have created a Blueprint of it, moving the root component does not affect the child component (the static mesh component).

So I would guess its because of my code from the inherited class. This is what I am using within the constructor:

 // Create a dummy root component we can attach things to.
 RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
 // Create a static mesh object
 building = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Building"));
 building->SetupAttachment(RootComponent);

But this does not work. I can also see this, when I am dragging the Blueprint into the level, the mesh always spawns at the origin and don't follow the mouse while dragging.

Product Version: UE 4.15
Tags:
more ▼

asked Mar 18 '17 at 12:15 PM in C++ Programming

avatar image

LifeArtist
47 5 11 18

avatar image 6r0m Mar 22 '19 at 08:57 AM

did you solve this?

avatar image LifeArtist Mar 27 '19 at 01:14 AM

Unfornutally I cant remember the exact problem but I think it is working. I cant really see a different in the setup I have made. Would you like to share more information about what exactly happens?

avatar image 6r0m Mar 27 '19 at 05:03 AM

the same thing which you described, may be because components was statics

avatar image LifeArtist Mar 27 '19 at 01:52 PM

Thats a good point! I have checked the Mobility section inside the static mesh after it was created and it showed that it was set to movable (As I said I cant reproduce this problem neither know what I did). Maybe they have changed the default ?!

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question