How do I knock back

  • So I have my character knocking back when the Owl Wind hits him. I am trying to get him to be knocked back possitive direction when he is on the right side of the owl...not sure how to do this..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could just check the Owl.X against the Character.X and set it negative accordingly:

    If Owl.X < Character.X then knockback = knockbackAmount

    if Owl.X >= Character.X then knockback = -knockbackAmount *

    The above pseudo code should give a good idea of what to do. Hope it helps and good luck with your project.

    (* One note, this line has a greater than or equal to because of you only test < or > and forget the = you will introduce a bug where knock back never happens when the values are equal. You may already know this but I have seen many people forget to include the equal to in these situations so I am spelling it out just in case.)

  • looks like this worked, thanks for the reply

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