how would you do this?

eliehangeliehang Member, PRO Posts: 105
edited November -1 in Working with GS (Mac)
I have an actor with a walk going right. the walk has a animation. I also have a shoot with a shoot animation. when I walk and shoot at the same time, both animation play at the same time and starts to glitch. Is there a way you can destroy the animation with a new one in order to work? or is there a better solution?! I've been trying to figure this out for a while. Anyone here can help?

Comments

  • FoleyFoley Member Posts: 37
    create a boolean game variable called SHOOTING.
    If you have the shoot button down, SHOOT is TRUE
    Otherwise, SHOOT is FALSE

    If SHOOT is TRUE
    you use the walk and shoot animation

    If SHOOT is FALSE
    you use the walk animation
  • eliehangeliehang Member, PRO Posts: 105
    Thanks, I tried doing that but it still glitches.. I might placed it wrong... how would you set that up?
  • FoleyFoley Member Posts: 37
    you have to make sure that both conditions can not be true at the same time. It sounds to me like there is a logic error in your code where both conditions are being fulfilled, so you are getting a double positive.

    Are you making sure to set your SHOOT variable back to FALSE when you are no longer touching the fire button?

    If that is not the problem there are a couple other things you could try:
    you could nest the conditions (if shooting, then shooting anim, OTHERWISE if walking, then walking anim).

    Or you could add extra conditions to your statements to make sure you are not getting douple positives (if shooting and walking then... , if walking and NOT shooting then...)
Sign In or Register to comment.