Skip to content

Instantly share code, notes, and snippets.

@Kurukshetran
Forked from jakevsrobots/AnimateTransform.cs
Last active November 4, 2015 02:53
Show Gist options
  • Save Kurukshetran/39869acd28d24e46f9ac to your computer and use it in GitHub Desktop.
Save Kurukshetran/39869acd28d24e46f9ac to your computer and use it in GitHub Desktop.
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