Water velocity

Hi!

I have a problem:
I use simple water prefab and add Rigidbody proprty to it. wrote script to make water moving

var speed=3;
function FixedUpdate () {
 rigidbody.velocity = Vector3(0,0,-speed);
 }

In rigidbody properties I forbid moving for z,y and rotation for x,y,z.

on water i have Player cube(rigidbody) and enemy(rigidbody).

all work fine. enemy on water and move with water speed.

but when i add one more enemy(cube with rigidbody) then first enemy and second fall through water.

Why?

what to do, or г have another way to make what i want?

PS. Sorry for My english)

Hi, welcome to the forum!

You might find this works better if you use a constant force component to simulate the current of the water.