• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Make unit play walk animation

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
I'm building a custom spell where a large beetle charges forward, knocking back enemies in the way and stunning himself if he runs into a wall.

Most of it is working how I want it to but I've run into a problem. I can't get the beetle to actually look like he is moving. He just slides in the direction (I am using SetUnitX(u, x) and SetUnitY(u, y) to move him).

This is a big deal-breaker for me since it will not look right if the beetle doesn't play his walk animation.

The thing is, I got it to work playing the beetle's birth animation (it just doesn't loop yet, but I can handle that part later). So the problem seems to just be that I can't get the "walk" animation to play.


TL;DR: I got my trigger to work with "birth" animation but I want it to play "walk" animation.

Any idea why it's not working?
 
Level 12
Joined
May 22, 2015
Messages
1,051
I'm going to mess around with a potential solution and report back. I will see if I can give the beetle a move command a bit further ahead each time I move it so that it is constantly ordered to walk forward.
 
Level 5
Joined
May 6, 2013
Messages
125
The regular play animation functions cant play walk-animations for some reason, it's one of the many quirks of warcraft 3.

The Jass-Only SetUnitAnimationByIndex(unit, int) can do it. Which int you need to put in there to get the walk animation is different for every model, but since you only use the same beetle model, that shouldnt be a problem.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Thank you so much @Imp Midna . I will test that out. I am coding all in JASS anyway so that is fine.

I tried my experiment but I did something wrong. The beetle ended up going in a circle haha. It looks funny at least. Either way, it is canceling the animation repeatedly like that so it doesn't look right.

I'll report back after trying the animation by index function.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I tested it out. Turned out to be index 2 for the beetle model. Thank you so much for your help!
 
Status
Not open for further replies.
Top