Skip to content

Instantly share code, notes, and snippets.

@jakevsrobots
Created September 29, 2014 14:20
Show Gist options
  • Save jakevsrobots/37c2a30f9ce54489f98e to your computer and use it in GitHub Desktop.
Save jakevsrobots/37c2a30f9ce54489f98e 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