- Home /
How to perform a smooth push in the opposite direction of a wall
Good evening,
i'm having an issue with my current code and maybe someone can explain to me how to solve it. First of all, i would like to create a copy of meatboy, and i'm having an issue when i press the jump button while sliding on a wall.
To be clear:
The player is jumping as long as he pressed the space button, or reaches a Max range distance
The collision with the wall is via trigger
Pressing space button while on the ground will make him slide on the wall
Pressing space while on the wall should make him jump a tiny distance in the opposite distance
The problem i'm having:
I can jump, however, if the wall is on the right and i'm holding both space and right arrow pressed, the InputJump is selected but the player does not jump
What have i tried:
Addforce (but it looks totally unrealistic, basically it kinda teleports the player in the opposite direction and it pushes him very fast towards the wall if the arrow is pressed towards that direction)
Stop all forces and add force afterwards.
Modifying the velocity manually
Please give me some suggestions about how to make a smooth jump. I will provide the code or part of it if required.
Thank you,
Robert
Your answer
Follow this Question
Related Questions
My movement function with jump won't work with collider function 1 Answer
Character Fails To Jump Sometimes 1 Answer
Only Collide When Certain Animation is Not Playing 0 Answers
Colliding two GameObjects 1 Answer
get only one colliding body 3 Answers