I have a RigidBody2D and while I’m moving it horizontally it gains a supernatural strength when it encounters some pointed collider … why does this happen? I have tried to apply some settings in RigidBody2D but I did not succeed.
Would you mind posting the code that drives your character’s movement? It would help a lot to figure out the source of the issue. Please use code tags.
Well, the solution doesn’t immediately jump out to me, but some things to try:
Move your horizontal input polling to Update, you want the inputs to be frame-accurate. You may also want to try using “rgb2d.AddForce(Vector2.right * hVelocity)” instead of setting velocity directly. You’re probably overwriting any deceleration due to resistance or friction caused by the surface at a steep angle, possibly causing the upward motion as it’s redirected each frame by the physics system correcting for collisions.
Yeah, I would expect it to continue pushing, but at least now it will take into account deceleration. Is it possible that given your gravity and speed settings, it’s simply using that angle as a ramp? If your goal is to keep the player on the ground at all times while running, you could do a raycast downwards and move the player to the ground, then stop raycasting during a jump until grounded again.
The physics system is designed to be as realistic as possible, so if you want something unrealistic like an object not carrying momentum off an incline, you’ll need to code something to make that behavior happen.