Hurt Animation Not Working

jfanz

New member
Capture 2.PNG

I'm doing the advanced adventure game module, and I'm running into a weird error where when I run into the spikes, the hurt animation doesn't play and instead, the character flies backwards at rapid speed and I permanently lose control over the character. Does anyone know how to fix this?
 

AllDarnDavey

Active member
Double check the hurtPlayer script you have assigned, but every module I've used has the hurt animation hard coded for action7. You have to make action 7 your hurt animation, or find and update the hurtplayer script to use 6 instead.

The character flying backwards is caused by the recoil set in doHandlePhysics. Do a search for "recoil" and you can adjust the amount of recoil and it's duration.
 

dale_coop

Moderator
Staff member
It might be the recoil, when your player is hurt, he's knocked back... but for some reason, on some module the recoil is too HI!
Try modifying the Handle Physics script... search for the RECOIL_SPEED_HI constant value, and try using a smaller value (maybe #$01)
 

jfanz

New member
I tried changing RECOIL_SPEED_HI, but now the player just flies back infinitely at a slower speed. There seems to be some kind of infinite switch that is being triggered (or just an absurdly high variable). I cannot find any script called hurtPlayer.
 

Ayrik

New member
Yes, it has to be action 7 unless you change all the scripts that reference that action. The recoil happens the entire duration of action 7 by default so you have to make it end at some point.
 

Jonny

Well-known member
PasseGaming said:
i have a similar issue with trying to get death animations working. Frustrating.

It can be frustrating but once you get it to work its more rewarding :)

Seems obvious but if I can't figure out whats wrong I usually go back to a tutorial which covers it and check literally everything Joe shows and says. It could be something silly like in the monster/player setup or simply that the script isn't there in the module and needs to be added or adapted to fit the game. If its the monster death, he definately goes over that in the adventure tutorials. He makes the poor guy spin when hes been hit.
 

jfanz

New member
Capture 3.PNG

Capture 4.PNG

Sorry, I'm still lost because I'm not sure what you guys are referring to. I posted the script that I think you are referring to, but I'm not sure which variable to change.
 

Jonny

Well-known member
jfanz said:
I'm doing the advanced adventure game module, and I'm running into a weird error where when I run into the spikes, the hurt animation doesn't play and instead, the character flies backwards at rapid speed and I permanently lose control over the character. Does anyone know how to fix this?

I had something similar when testing, ended up with a stuck player too. Tbh I don't know why recoil is there by default, seems like a very specific advanced and potentially game breaking feature for beginners.
 

dale_coop

Moderator
Staff member
Make sure you set correctly the Action Step 7 (on your screenshot, original post, you shared the action step 6)... just check and make sure you set the correct one.
 

Ayrik

New member
Best idea is not to change the script because you'd have to change a bunch of scripts. Just make sure hurt is on step 7.
Annotation 2020-09-30 080952.png

If you want to change it in script you can change that line 244 to CMP #$06. But you'll have to search for GetActionStep in all your script files and change all of them in order to make it work correctly.
 

dale_coop

Moderator
Staff member
And it's not the only script... I think A LOT of scripts expect the Action Step 7 for being the hurt state...
(for example, I am also pretty sure that in the physics script, the action step 7 is checked to do the recoil system)
 
Top Bottom