Advertisement
Cookie042

ffs zacko

Jan 18th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using UnityEngine;
  3.  
  4. public class FlapperFlipper : MonoBehaviour
  5. {
  6.     public Transform flapper;
  7.  
  8.     public float rotationAmount = -270;
  9.     public float rotationSpeed = 1; //degrees per second
  10.  
  11.     private float currentRotation;
  12.  
  13.     // Update is called once per frame
  14.     void Update()
  15.     {
  16.        
  17.         currentRotation = Mathf.MoveTowards(currentRotation, rotationAmount, rotationSpeed * Time.deltaTime);
  18.         flapper.localEulerAngles = new Vector3(0,0, currentRotation);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement