- Home /
Lerp passes through colliders 2d
Hey all,
Using this code my main character passes through colliders. I was attempting to make the character dash, it works okey except for that passing through colliders part.
transform.position = Vector3.Lerp(transform.position, newposition,counter);
Anyone encountered this before? Thanks a bunch :)
You mentioned 2D...the 3D physics and 2D physics systems are entirely different and do not interact.
Answer by Yword · Mar 12, 2014 at 04:20 PM
If you are directly manipulating the Transform component of your object but still want physics, attach a Rigidbody or Rigidbody2D and make it Kinematic.
For 3D kinematic rigidbody, I think it will be better to use MovePosition().
For all non-kinematic rigidbody, you should use AddForce() or AddForceAtPosition() to move it, or directly manipulate its velocity.
Your answer
![](https://koobas.hobune.stream/wayback/20220613140028im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Collision with 2 CharacterControllers not precise 1 Answer
OnTriggerEnter detection too late 0 Answers
OnTriggerEnter2D problem on created collider2d and rigidbody2d during runtime 0 Answers
High speed 2D colliders going through eachother? 2 Answers
Pausing/Waiting/Stopping code in a 2D Collision Function 1 Answer