Floating object on the water and stand on it.

Hi, I have a problem about floating object on the water.

Video:
Example

I want stand on the ice and jump to next ice, but…ice is crazy rotation…how can I fix that?

My script(& I use mesh collider on the ice,is it right?):

using UnityEngine;
using System.Collections;
 
public class floatWater : MonoBehaviour {
 
    public float offset = 1.5f;
    public float speed = 0.8f;
    private Vector3 startPos;
 
    void Start() {
       startPos = transform.position;    
    }
 
    void Update() {
       transform.position = startPos + Vector3.up * Mathf.Sin (Time.time * speed);   
    }
}

Thanks a lots for the help :frowning:

Hi!

In the rigidBody for the ice you can set Freeze Rotation for each axis in the Constraints section. Would that do what you need?

Jonny.