Hi
Can any code gurus help with code or logic to create a realistic floating motion? I need a combination of random pitch and yaw as well as vertical or y axis bobbing motion.
Is it on the surface of water?
Or do you mean floating in air? (cause ummm… there is no realistic air floating, ships don’t float in air)
How are you animating the water? Can you get data from that animation to control the orientation of the boat? (note the sort of flow of the water plays a huge role here… big difference between river, coastal ocean, and open ocean for instance)
Usually people use things like perlin noise to create water/wave type animation. Using the values from it to define height of the wave… which means you can get the normal at a point as well… which you can use to calculate a bob (height) as well as up orientation (normal).
Thanks! Using native water in Standard Assets. I don’t think Perlin noise is used though could be wrong…Boats will be “floating” in place.
I was hoping to “cheat” buoyancy to save resources since this is for mobile.
Apply a couple of upwards forces in sine wave patterns to different sections of the hull. That should give a random looking bobbing pattern. Bonus points if you match the sine waves to the natural oscillation of the water.