- Home /
Can I have a collision between 2 objects, but without preventing one from moving?
I have a lake and I want to place a square without renderer which covers all place below water to detect when player is inside the water, but is there any way to place that collider so my player can pass, yet he can also detect the collision in script? Please don't give me an alternative before answering my question, thanks.
Answer by gregzo · Apr 09, 2012 at 09:45 PM
Set the collider of the object you don't want to move to isTrigger, then use OnTriggerEnter() insteand of OnCollisionEnter. Careful, on trigger takes a Collider as param, not a Collision... Look it up in the docs!
Your answer
![](https://koobas.hobune.stream/wayback/20220613070117im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can I detect collision without preventing movement? 1 Answer
Water4 looks like fog; no surface 1 Answer
Island collider 3 Answers
Ignore collider in rigidbody 2 Answers
Network - Projectile, Prevent Collision with Parent 2 Answers