Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Vector3 posOffset = new Vector3();
  2. Vector3 tempPos = new Vector3();
  3.  
  4.  
  5.  
  6. void Start () {
  7. posOffset = transform.position;
  8. }
  9.  
  10. void Update () {
  11. tempPos = posOffset;
  12. tempPos.y += Mathf.Sin (Time.fixedTime * Mathf.PI * frequency) * amplitude;
  13.  
  14. transform.position = tempPos;
  15.  
  16. if (floating == true){
  17. Float();
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement