Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using UnityEngine;
- public class FlapperFlipper : MonoBehaviour
- {
- public Transform flapper;
- public float rotationAmount = -270;
- public float rotationSpeed = 1; //degrees per second
- private float currentRotation;
- // Update is called once per frame
- void Update()
- {
- currentRotation = Mathf.MoveTowards(currentRotation, rotationAmount, rotationSpeed * Time.deltaTime);
- flapper.localEulerAngles = new Vector3(0,0, currentRotation);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement