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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I listen for an anim notify event on C++?

I have a montage with a custom notify and I have inherited the UAnimInstance to handle my animationBP from code, that being said I have access to the FAnimNotifyEvent but how do I declare a callback on C++? On the BP you just add a new "Anim notify event" and that's it, how can I do the same on code?

P.D. I don't want to add anything on my blueprint for this, how do I make the callback only on code side?. I think I could create a subclass of UAnimNotify (or UAnimNotifyState) and override their methods but then the callback implementation lacks the UAnimInstance's variables I have, so far I can only think about exposing the method I want to call on C++ for my BP to call it whenever the notify fires.

Product Version: UE 4.10
Tags:
more ▼

asked Jan 06 '16 at 12:34 AM in C++ Programming

avatar image

virtual_nomak
356 15 16 25

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

1 answer: sort voted first

If I understood the question correctly, this could help:

https://answers.unrealengine.com/questions/145350/create-animnotify-in-c.html

more ▼

answered Jan 06 '16 at 09:51 PM

avatar image

rantrod
1.5k 48 47 216

avatar image virtual_nomak Jan 06 '16 at 10:29 PM

I encountered that same question before, he is adding a notify from code but he has an inherited class of UAnimNotifyState where all the events fired by the notify are handled, and as I pointed out I want to be able to create a callback on my UAnimInstance custom class (like you would usually do on a BP), if you know of a way to connect the event from the UAnimNotifyState to the UAnimInstance callback please let me know.

avatar image rantrod Jan 06 '16 at 10:54 PM

If you derive from AnimNotify, the first argument to the callback (Received_Notify) is USkeletalMeshComponent. You can get to your anim instance from there.

avatar image virtual_nomak Jan 07 '16 at 01:16 AM

Oh really? didn't notice that, thanks! Edit: I just did some refactoring on my code and this totally worked, thanks again for your help :)

(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