-
-
Save Kurukshetran/39869acd28d24e46f9ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class AnimateTransform : MonoBehaviour | |
{ | |
public float speed = 1; | |
public Vector3 positionChangePerSecond; | |
public Vector3 rotationChangePerSecond; | |
public Vector3 scaleChangePerSecond; | |
void Update() | |
{ | |
transform.Translate(positionChangePerSecond * Time.deltaTime * speed); | |
transform.Rotate(rotationChangePerSecond * Time.deltaTime * speed); | |
transform.localScale += scaleChangePerSecond * speed; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment