I have some spells, which toss enemy units into the air. When these enemies die in mid-air, the death animation is played, but stays in mid-air.
Is there some easy way to make the death animation fall to the ground?
I wouldn't say there's an easy way, the only way I can think of is for you to do the follow on each unit type that your ability can be casted on:
In the actor's event tab (or just hit events if you're on table mode) create an event that's something like this:
[Event] UnitDeath.<your unit here>
[Term] (find a term that is able to identify the fact that your ability is being used on this unit)
[Action] Set Height (this command doesn't show a number when it's 0, but it doesn't have a blend time parameter which makes me think this will apply the height instantly. I haven't tested this so it's worth a try. There are other "charge height" commands, so you can try them as well)
If you don't care how you do this (Data editor or trigger editor), you can make a universal trigger that affects any unit that is a victim of your ability.
The conditions is a work around that might not necessarily be accurate, but if you could find a condition that checks for a buff or ability being cast on the dying unit, then that would be ideal.
Of course you may need to play with this for situations where the unit dies while it's being lifted or while the ability is letting go. (so that it doesn't take 3 seconds to fall half a centimeter)
Events
Unit - Any Unit dies
Local Variables
Conditions
(Height of (Triggering unit)) > 0.0
((Triggering unit) uses Fly mover) == false
Actions
Unit - Change (Triggering unit) height to 0.0 over 3.0 seconds
Well, the events trigger after the units are dead and unlike in wc3, the death animations are not the actual units playing an animation, but a separate model, which does not get moved, if you move the unit itself (in fact, the unit does not even exist anymore while the death animation is playing, if the death time is set to the default 0), so both your solutions unfortunately will most likely not work (I tried modifying the unit's heigth before, but did not manage to make it affect the death animation at all)
Its just a visual bug after all, so no top priority to fix, but its quite annoying.
Hey
I have some spells, which toss enemy units into the air. When these enemies die in mid-air, the death animation is played, but stays in mid-air.
Is there some easy way to make the death animation fall to the ground?
I wouldn't say there's an easy way, the only way I can think of is for you to do the follow on each unit type that your ability can be casted on:
In the actor's event tab (or just hit events if you're on table mode) create an event that's something like this:
[Event] UnitDeath.<your unit here> [Term] (find a term that is able to identify the fact that your ability is being used on this unit) [Action] Set Height (this command doesn't show a number when it's 0, but it doesn't have a blend time parameter which makes me think this will apply the height instantly. I haven't tested this so it's worth a try. There are other "charge height" commands, so you can try them as well)
If you don't care how you do this (Data editor or trigger editor), you can make a universal trigger that affects any unit that is a victim of your ability. The conditions is a work around that might not necessarily be accurate, but if you could find a condition that checks for a buff or ability being cast on the dying unit, then that would be ideal.
Of course you may need to play with this for situations where the unit dies while it's being lifted or while the ability is letting go. (so that it doesn't take 3 seconds to fall half a centimeter)
Events Unit - Any Unit dies Local Variables Conditions (Height of (Triggering unit)) > 0.0 ((Triggering unit) uses Fly mover) == false Actions Unit - Change (Triggering unit) height to 0.0 over 3.0 seconds
Well, the events trigger after the units are dead and unlike in wc3, the death animations are not the actual units playing an animation, but a separate model, which does not get moved, if you move the unit itself (in fact, the unit does not even exist anymore while the death animation is playing, if the death time is set to the default 0), so both your solutions unfortunately will most likely not work (I tried modifying the unit's heigth before, but did not manage to make it affect the death animation at all)
Its just a visual bug after all, so no top priority to fix, but its quite annoying.
@Kueken531: Go
Then do all of the above on the actor of the death model