Recoil?

Player_EPlayer_E Member, PRO Posts: 604
edited November -1 in Working with GS (Mac)
I am currently working on a shooter and I was wondering how to work a recoil feature into the game when the gun is fired.

I want the aimer to jump up when fired then work it's way back down to where it was. does not necessarily have to be the same exact spot (I prefer it is not the same spot to make it more realistic).

right now I have it set so I take advantage of interpolate, but it does not work quite right. I can make it so the aimer jumps up, but it stays in that position and does not work it's way back down.

any thoughts?

Comments

  • ORBZORBZ Member Posts: 1,304
    Change velocity to a high value in the up direction

    Then interpolate back down
  • Player_EPlayer_E Member, PRO Posts: 604
    @TSB yeah I tell it to interpolate to a self position y + 10 the tricky thing is that I can move the aimer around the screen, so I cant just tell it to go to a specific x or y.

    ill give both these ideas a try in the morning and ill post back with what works best.

    thanks for the tips
  • Player_EPlayer_E Member, PRO Posts: 604
    I got it working with the use of a timer. when gun is fired I interpolate coordinates then after .5 seconds I interpolate them back down.

    I wanted to try and stay away from timers, but due to the fact that I move my aimer across the entire scene I could not simply just move to specific X,Y and then move back.

    Thanks for the help guys!
Sign In or Register to comment.