Add a animation effect to your game object through simple line code in unity
Add this line to your script update funtion and the object in which this script is added will show you a rotating animation at its position
void Update () {
transform.Rotate(new Vector3(15,30,45) * Time.deltaTime);
}
Another one is changing the angular velocity of object
Here we will use Random.insideUnitSphere which return random point
void Start ()
{
rock = GetComponent<Rigidbody>();
rock .angularVelocity = Random.insideUnitSphere * 5;
}
Through this code your object will show you a rotating effect and its look like your object is animating
Try this and have fun
0 Comment(s)