• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Move a Unit without interrupting an animation?

Status
Not open for further replies.
Level 6
Joined
Aug 22, 2005
Messages
113
I want a custom arrow key movement system in my game, to be able to have on-the-fly movement using the ''Move (instantly)'' action. How can I do this without having their animation be reset to Stand?

EDIT: Bah. Wish I could delete this post.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
You can use two JASS lines, it's really simple:

  • Actions
    • Set YourUnit = ...
    • Set YourUnitLoc = Position of YourUnit
    • Set NewLoc = YourUnitLoc offset by bla bla
    • Custom script: call SetUnitX(udg_YourUnit, GetLocationX(udg_NewLoc))
    • Custom script call SetUnitY((udg_YourUnit, GetLocationY(udg_NewLoc))
Those two functions don't stop the animation, afaik. You can name your variables whatever you want, but be sure to change the parts after "udg_" too.

If something isn't clear, I can explain further.
 
Status
Not open for further replies.
Top