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