- Home /
How to make a GameObject collide properly with an animated plane?
Hi there,
I need to make a boat float upon 'water' which is an animated plane.
For the water I'm using a Plane with a shader which uses simplex noise to displace the vertices, and create a wave-like motion. The goals is to create a cartoon style ocean. I am using this free shader on the water plane.
Now I want my boat to stick to the surface of the water. What I want to do is get the Y position of the vertex closest to the boat, and then Transform the boat's Y position to match... in the Update function I guess?
I have a feeling this is the totally wrong way to do it, but I'm very new. It's the way this tutorial handles it.
It seems like it will be laggy, so please let me know if there's a better way... such as just having the plane collide properly with the boat using physics? Right now, the boat simply collides with the Plane's original mesh, which is just flat and static.
I also looked into passing the update mesh to the Boat's Transform using sharedMesh but I dont understand how this works or to make that happen. Heheh.
Thanks for any help you can provide. It will be much appreciated by this newbie.
Your answer
Follow this Question
Related Questions
Water & Fabric compute shader 0 Answers
Help with Liquid Physics2D 0 Answers
Bouyancy timing issue 0 Answers
Making water physics 0 Answers
How can I fake buoyancy (floating) with a configurable joint (or with a script)? 3 Answers