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"

Calling a method when an actor attaches to another actor

Does anybody know how to make an actor call a method when it is attached to another actor? I noticed that there is an event within Engine.h that fires when this happens, but it is declared private (and it'd probably trigger every time any actor is attached to another actor instead of just firing when my actor is being attached).

I am currently overriding the OnEditorMove method and just moving my actor a little bit after attaching it to another actor in the editor, but this is obviously not ideal and results in my code being run every time the actor is moved. Also, it doesn't catch the case of my actor being attached during gameplay (not too big of a deal, because I can just create my own method for attachment so long as nobody forgets to use that one instead of the regular one). All of the attachment functions I've seen so far have not been declared virtual, so I am unable to just override those without editing the engine's source code hoping that it doesn't result in some unintended consequences.

Product Version: UE 4.15
Tags:
more ▼

asked May 05 '17 at 02:11 AM in C++ Programming

avatar image

taylorjoshua88
1

(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