Maybe you guys can help me with this
So on bullet hit I want the npc to change to "Hit" Animation for about 3 seconds then back to its current animation. When i try it doesnt work.
my CapX looks like this
Heres the capX download
dropbox.com/s/trj0hgrbtapih46/shoottohittemplate.capx
Any ideas?
I have idea that you could have an instance variable that called "hitCooldown".
Then you check if the enemy is playing "Hit", you add dt to this until it >= 3, set it back to normal animation and =0.
Develop games in your browser. Powerful, performant & highly capable.
I have idea that you could have an instance variable that called "hitCooldown". Then you check if the enemy is playing "Hit", you add dt to this until it >= 3, set it back to normal animation and =0.
Thanks for your help. I'm not sure what you meant to be honest I tried this
didnt work though. :(
TitanGames
The problem is in your event 2 because this event is continuously true while the NPC is not moving so the sooner you set Animation = 2 on collision with the bullet, the Event 2 sets it back to 0 right away and you gonna have the same problem with Event 3 if the Npc is Moving so the best thing is to add a boolean then put event 2 & 3 under it
Then just Activate the Boolean on bullet hit and use a (Timer) 3 sec to deactivate it back again
see here on the picture I added a boolean "Hit"
https://www.dropbox.com/s/svzw0hzmbdj5lwd/Change%20Animation%20on%20Hit.png?dl=0
My instance variable is not boolean.
Here is what I fixed:
drive.google.com/open