Another animation hitch. Why oh why?!
Okysho
Member Posts: 158
Special thanks to cbt who helped me out with my last problem, but as one door closes another one opens, so here I am with yet another animation problem.
When my player is running back and forth, the animation works fine, as normal like it should. I have it set up so that if the space bar is pressed, the animation will change to a shooting animation (this is while the player is moving left or right, there's a separate animation for standing which works just fine) If the player is running and the space bar is held down, though, the animation switches for a split second to the player running backwards before executing the proper running-shooting animation.
Maybe it's because I've got WAY too many rules in my player actor at this point, but there's just a couple more animations and I'm home free from this section and can actually go on to designing the levels and menus.
What can I do to fix this problem.
PS. When I finish all the animations, I'll publish a (pre?) Alpha so you guys can test the player mechanics if you want.
When my player is running back and forth, the animation works fine, as normal like it should. I have it set up so that if the space bar is pressed, the animation will change to a shooting animation (this is while the player is moving left or right, there's a separate animation for standing which works just fine) If the player is running and the space bar is held down, though, the animation switches for a split second to the player running backwards before executing the proper running-shooting animation.
Maybe it's because I've got WAY too many rules in my player actor at this point, but there's just a couple more animations and I'm home free from this section and can actually go on to designing the levels and menus.
What can I do to fix this problem.
PS. When I finish all the animations, I'll publish a (pre?) Alpha so you guys can test the player mechanics if you want.
Comments
however I've already tinkered with both of these and have a condition in which the space bar must not be pressed in order for these states to occur. (which works, because I encountered a "stand and shoot" problem where the player would rapidly change from shooting image to standing-and-shoot image,but this is fixed)
dont know if this will work but i figure you could take anything you can get that might possibly fix this
So far you idea isn't quite working, but that's probably because I forgot to constrain the "false" case in a couple places (there's a lot of player interactions...)
Thanks so much for your help
(I know adding more rules is bad for performance, but, this way we find out the source of the problem.)
*Add a boolean "Right"
*Add a boolean "Left"
Add a rule;
-When self.velocity.X > 0;
*Change att. "self.Right" to true
*Change att. "self.Left" to false
Add a second rule;
-When self.velocity.X < 0;
*Change att. "self.Right" to false
*Change att. "self.Left" to true
And a third one;
-When self.velocity.X = 0;
*Change att. "self.Right" to false
*Change att. "self.Left" to false
--
Now on your right going animation rule which contains;
*pressed space
Add this condition too;
"self.Right" is true
--
Do the same thing for left also. And be sure on the rule window, "ALL" is selected, not "ANY".
And for you standing animation rule add this;
"self.Left" is false
"self.Left" is false
If this doesn't work too, just post a pic. with the rules :P
Move left rules
http://i46.photobucket.com/albums/f101/Okysho/Moveleft1.png
http://i46.photobucket.com/albums/f101/Okysho/Moveleft2.png
Move right rules
http://i46.photobucket.com/albums/f101/Okysho/Moveright1.png
http://i46.photobucket.com/albums/f101/Okysho/Moveright2.png
Fire Left rules
http://i46.photobucket.com/albums/f101/Okysho/Fireleft.png
Fire right rules
http://i46.photobucket.com/albums/f101/Okysho/Fireright.png
animation rules for:
shoot moving left
http://i46.photobucket.com/albums/f101/Okysho/shootmovingleft.png
shoot moving right
http://i46.photobucket.com/albums/f101/Okysho/shootmovingright.png
and just for good measure, in case there's a hidden clue in here...
movement commands:
http://i46.photobucket.com/albums/f101/Okysho/movement1.png
http://i46.photobucket.com/albums/f101/Okysho/movement2.png
maybe it was a mistake to take on a project this big... there's just so many rules in this actor...
And the exact same thing for the "right walk animate". And do not check "run to complication".
Kidding.. I couldn't see any rule to turn "self.shooting" to false, but, I'm guessing when you turn it to false or change your velocity, the animation rules become "true" for a split second.
But, I'm not really in thinking mood right now. Had a tough day. Will give it a look in the morning again..
Sorry you had a tough day.
By the way, don't forget to add ["face.right" is false] to the "Shooting Left" animation rule. And same for the right one. Just in case..
oh and i wouldn't be mad if i was slipped a code either, just saying. i think darren might have a template with a walking dude that shoots a projectile, i don't know how he pulls it off.
I'm trying to find a way to do this without re-writing too much. If I split my animations, I'd have to split the actor in half, which doesn't sit well with me
It's not that big of a deal to me anymore this time around, like my first animation problem, I can live with a split second of turning around (the animation not the velocity) before heading in the right direction.
All the main logistics and mechanics work besides these small animation errors.