Object sinking in water JME3

Hello,

I made a project presenting a landscape with the following elements:

  • ImageBasedHeightMap representing some mountains;
  • WaterFilter representing water;
  • a Spatial object, for example a boat.

The problem is that my boat is sinking in water. Do you have any ideea how to solve this problem?
Thanks.

What do you mean by sinking ?
Have you activated some kind of physics ?

Well the water in jme is only grafic effect, you have to iomplement the floating yourself

What you can do is to use a geometry with grid mesh with cull hint to always (so it’s never rendered) in place of the water.
Then you add this object to the physic space so the boat will just land on it.

I suggest a ghostObject to check for overlaps and then applying an upwards force to the objects when they are in the water. Also maybe reduce the angular factor when they are in the water.

Shortcut, if you have like farcry water always at 0, you can simply use a controller, that checks the location.y

@Empire Phoenix said: Shortcut, if you have like farcry water always at 0, you can simply use a controller, that checks the location.y

…then all caves are flooded :wink: But yeah, for simple stuff thats probably the way to go and as the post water is always visible at the specified height you’d have to switch that as well anyway.