Hi everyone,
i just started my experience with unity a few days ago and i got stuck with this problem that probably for the most of you is a stupid issue.
I’m actually using the 2D setup , trying to make a RPG game FFV like.
I’ve created a Sprite object for the main character,with a 2D Box Collider and rigidbody (setting gravity scale to 0, so it doesn’t fall down).
Now, when the sprite collides with another sprite, or a simple Quad Object with another box collider 2D (i’ve created a custom 2D Physics Material for this last one with 0 friction and 0 bounciness) it bounces back a little, i’ve tried to look around for long and can’t find a way to make the sprite just stop walking with no bounceback.
Can someone help me working this out?
Thanks in advance
(PS:I’m using a custom Character Controller 2D to move the character and i’m not making it use the physics for movement so i’m sure it doesn’t interfere with the general physics)
Answer about Position Iterations helps in general, but if you have a very dynamic character - you can set him property in Rigidbody2d > Collision detection to Continuous instead of Discrete (but it could affect on your performance, because continuous consumes more resources).
Go to your PhysicsSettings2D in Edit > Project Settings > Physics 2D. There is a field called Position Iterations… Change it to a higher number (maybe 5 or more). This should stop the bouncing.
I’m not sure if I get this right, but if you want it to have a rigid body and not be affected by physics at all you can check the “Is Kinematic” box in the rigidbody2D feature.
i found Solution its late but its working do not use transform.translate or transform. position for player movement . use rigidbody that will work…
this work for me…
ground = Physics2D.IsTouchingLayers (GetComponent (), plank);