Make player recoil when hit?

0 favourites
  • 6 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • I want the player to recoil when they're damaged by the enemy. The best way I can see to do this is on collision with the enemy, set vector x to whichever direction. The problem is I want the player to recoil faster than that. If I change the player's max speed and then set vector x, this seems to work, but then the player is able to move very quickly during that time. What is the best way to go about bouncing the player back?

  • Disabling controls during recoil would take care of any further movement, wouldn't it?

    start ignoring user input it was called I thought..

  • For reference, how would I handle this if I want the player to retain their control without allowing them to move so quickly during the recoil?

  • With a lot of conditions.

    Every exception to the rule has to be described in detail as not to interfere with the rule in general.

    What would probably be best is to have a completely new set of rules during recoil.

    So create a group for movement during recoil and one for normal movement and setting the normal movement deactivated during recoil and the recoil movement deactivated during normal movement.

    But Then again, I'm not sure what kind of control you'd like the player to have and what is happening now and why that isn't good, so maybe you could avoid it with a very simple event..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you for sharing your work and impressions. I love your choices.

  • give your player bullet behavior.set it disabled on start

    when enemy on collision with player

    player x<enemy x               then

                                 set player platform behavior disabled

                                 set player bullet enabled

                                 set bullet angle of motion 180

                                 wait x seconds (you decide)

                                   set player platform behavior enabled

                                 set player bullet disabled

    when enemy on collision with player

    player x>enemy x               then

                                 set player platform behavior disabled

                                 set player bullet enabled

                                 set bullet angle of motion 0

                                 wait x seconds (you decide)

                                   set player platform behavior enabled

                                 set player bullet disabled

                                

    this way you can set any speed for the bullet until you are happy with the result

    tip if you want arched hitback then set gravity for bullet to on and go for bullet angle of motion to 240 and 320 !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)