I'm trying to disable unit movement when an attack animation starts and then enable it again once it finishes. I know how to disable/enable movement, but I can't figure out how to tell when the animation ends. I gave the animation an identifier, but I didn't see a way to check if it finished or to check the current animation playing on a unit. I guess I could manually get the animation length and put a timer in, but I was hoping there was an easier way.
What I can think of:
In the unit's main actor add the event
Animation finished /done
(as a parameter "attack" or whatever it is called)
For the action, you need to be creative. I don't have the editor here so I can't check all possible actions, but maybe there is some way to start an effect (I am pretty sure there is something like this).
If you use a dummy damage-effect that only deals 0.01 damage you can then register this damage effect to a trigger easily.
BTW: How do you disable/enable movement? :D If you don't need script functions for this, then there might be an actor-action for this. This would shorten things a lot.
Thanks for the reply, I haven't used the data editor much so I'm going to have to mess with it a bit to figure everything out.
For the movement I meant I know the actions to stop/start the movement, but not how to do it at the right times. If you were just asking for the action I used then it was Set Unit State - Movable on/off.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to disable unit movement when an attack animation starts and then enable it again once it finishes. I know how to disable/enable movement, but I can't figure out how to tell when the animation ends. I gave the animation an identifier, but I didn't see a way to check if it finished or to check the current animation playing on a unit. I guess I could manually get the animation length and put a timer in, but I was hoping there was an easier way.
What I can think of: In the unit's main actor add the event Animation finished /done (as a parameter "attack" or whatever it is called)
For the action, you need to be creative. I don't have the editor here so I can't check all possible actions, but maybe there is some way to start an effect (I am pretty sure there is something like this). If you use a dummy damage-effect that only deals 0.01 damage you can then register this damage effect to a trigger easily.
BTW: How do you disable/enable movement? :D If you don't need script functions for this, then there might be an actor-action for this. This would shorten things a lot.
Thanks for the reply, I haven't used the data editor much so I'm going to have to mess with it a bit to figure everything out.
For the movement I meant I know the actions to stop/start the movement, but not how to do it at the right times. If you were just asking for the action I used then it was Set Unit State - Movable on/off.