Hello! I and my friend are making a short platformer game and it has a shotgun. I and my friend wanted the player to propel from the bullet similar to that from Dani’s Karlson, or Rocket Jumping from TF2, I’ve tried many times, specifically the add force action, by making the speed a negative number instead of a positive one. But the force is so instant the player just magically teleports. Is there a fix to this/any other way to do this?? Thanks in advance.
When you fire the shotgun create a timer called “KnockbackTimer” and store a variable called “KnockBackAngle” that is opposite of the angle you fired the shotgun at.
Then create a condition like this:
KnockBackTimer timer is not 0
KnockBackTimer timer is less than 1 sec
And a corresponding action:
Apply instance force at KnockBackAngle of 1000 speed to player object
This will apply the force every frame for a fixed amount of time.
Play with the angle, the timer, and the speed until it feels right.
I picked 1000 for the speed because it’s 1/3 the default gravity.
I picked 1s for the time because it will feel noticeable and maybe exagerated.
If the player is not allow to shoot at an angle, then just set the angle to 0 or 180 based on the direction they are facing.
You are setting the KnockBackAngle variable on the shotgun_debug object, and then trying to read it from the Player_hitbox object.
Once you fix that, if you don’t see an effect, try increasing the 1000 to something really big like 5000 or 10000.
Exactly how am i supposed to do it? is the KnockBackAngle supposed to be from somewhere else???
You better check where is the player facing then apply force to 0 or -180