Animation Frame Firing Function?


#1

Hi,
In other game engines, it’s possible to have animations triggering functions/events when they reach a certain moment/frame.
For instance, in Unity and Babylon.js this is called Animation Events.
Is this possible in Armory 3D? If it isn’t, how can I achieve a similar result? For example, how can I fire a function X seconds after an animation started?


#2

I don’t know about Animation Events, but the following is somewhat useful:
https://api.haxe.org/haxe/Timer.html
In addition, the animations start automatically, so you’ll want to scroll down to “Methods” here…
https://armory3d.org/manual/api/iron/object/Animation.html
Should be relatively simple to start an Animation and Timer and then have a function execute midway through the animation. Of course, the animation might not sync nicely, so the best approach is to make an animation marker and do this:

notifyOnMarker("didStuff(marker name)", doMore());

#3

There is a node “On action marker” too.


#4

Thank you guys, that’s exactly what I was looking for! :slight_smile: