Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 posOffset = new Vector3();
- Vector3 tempPos = new Vector3();
- void Start () {
- posOffset = transform.position;
- }
- void Update () {
- tempPos = posOffset;
- tempPos.y += Mathf.Sin (Time.fixedTime * Mathf.PI * frequency) * amplitude;
- transform.position = tempPos;
- if (floating == true){
- Float();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement