Detect collision between rigid body and grid,Rigid Body collision with grid
I am having problems figuring out how to do this. I have a "Grid" that is acting as "Water" for an scene. I was able to set it on a way where if my "Boat" hits it I can detect a Trigger, but I need it to detect a Collision so I can have access to the exact point where the collision happened.
I need a Y value to know at what level the boat should float. In this example it isn't important as the water is flat on the Y level, but for cases where I may have it rotated it will become important to know where the actual Y contact happened.
Any clues on how to go around this? I have tried some solutions I read on the forum, but then the boat lays flat on the water grid as it becomes a solid object.
Answer by applesthepi · Jun 18, 2018 at 11:20 PM
Have you tried these? OnCollisionEnter(Collision collision){} OnCollisionExit(Collision collision){} OnCollisionStay(Collision collision){} **I dont fully understand your problem
Hi, yes I have tried with OnCollision, but those don't get triggered by the grid that acts as water, but they do when the boat hits the wall.
If I remove the "Is Trigger" from the water mesh, the OnCollision work, but also my boat hits the water as a solid, ins$$anonymous$$d of "going thru it" I need the water to act as a transparent object, where a rigid body can go thru.
Your answer
Follow this Question
Related Questions
Add colliders to original/root asset? 1 Answer
How to know when the player object falls between tiles in 2D game to take decesion of gameover 1 Answer
Fast collisions 0 Answers
Object doesn't move through intersection of other objects 0 Answers
Unable to stop animation upon collision (2d, animation, rigidbody) 0 Answers