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"

AttachTo doesnt attach to

If i specify in c++ Gun = CreateDefaultSubobject(TEXT("Gun")); Gun->AttachTo(Mesh); and Create an blueprint class that inherits from it it wont be attached to anything until i rename it. This seems to be a hot reload problem or a problem within the blueprints.

Product Version: UE 4.8
more ▼

asked Jul 21 '15 at 01:02 PM in Bug Reports

avatar image

34 5 10 13

avatar image TJ V ♦♦ STAFF Jul 21 '15 at 03:05 PM

Hi gidcheen,

Thank you for the report. We have assigned one of our technicians to investigate your issue and they may post here with additional questions or comments.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey gidcheen-

When you use the CreateDefaultSubobject you have to specify what type of object you're creating. Using a static mesh component as an example:

 MyMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MyMesh"));

When you create a blueprint based on this class it will have the static mesh component attached to the NewScene component, which in this case is a SceneComponent that has been set as the root component.


Doug Wilson

more ▼

answered Jul 27 '15 at 09:10 PM

avatar image gidcheen Jul 27 '15 at 09:29 PM

Sorry that was a typo.

Thats what i did.

It wouldn't even compile otherwise.

For me the AttachTo() does nothing

AttachParent = ...; works as intended though.(Mostly)

I am wondering why it is fine with the parameters i give it. namely only the object i want it to attach to, but it is unchanged in the hierarchy after compile.

I have to change it to AttachParent and then delete all binaries and compile again. It doesn't change the hierarchy just with a hot reload.

avatar image Doug E ♦♦ STAFF Jul 30 '15 at 02:50 PM

Hey gidcheen-

I've not yet been able to reproduce the issue. Just to make sure I'm following the same steps, I created a class based on Actor and added a scene component and static mesh component to the class. After setting up both components as described above in the constructor of the class I compile and made a blueprint from that class which had the hierarchy setup properly. Let me know if you are using a different approach or if you have different results using this method. If possible could you post the full class you're using that is not updating the blueprint as well?

avatar image Doug E ♦♦ STAFF Aug 04 '15 at 03:13 PM

Hey gidcheen-

We've not heard back from you in a few days. I will be marking this post as resolved for tracking purposes. If you're still having issues with using AttachTo() you can add a comment to reopen this post and we will investigate further.


Doug Wilson

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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