Page 1 of 1

Jumping Sprites???

PostPosted: Wed May 19, 2021 5:45 am
by cherry_poptartz
Is there any way to have the players sprite change when they jump??? Like how Player.CrouchSprite defines the sprite when the player crouches?? Its very glaring visually when I jump in my project when the player is just thrusted in the air with no visual movement. I've searched the wiki for a while, including jumping, and I see no way to define sprites for jumping or anything similar so if anyone can help me with this I'd greatly appreciate it.

Re: Jumping Sprites???

PostPosted: Wed May 19, 2021 6:48 am
by Jarewill
You could do a velocity check and jump to specific states.
It's not perfect, but that's the best thing I can think of.

Here's an example in ZScript:

Note that you don't need to rewrite your player class if you are doing it in DECORATE.
You just need to make your class inherit from this ZScript one and you will be able to use the function in DECORATE.
Just delete the example states as they might mess with something.