Transform rotation with an ease
Hi,
I have created a simple room with a floor and four walls. I am trying to rotate the walls on their z axis so it looks like they are falling down. The below works fine, but I'd really like to add an ease to this movement so the rotation starts slow and then gets gradually faster. I'm very new to unity and c# so not sure where to start. Any help would be great.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExplodeTrigger : MonoBehaviour
{
// Wall
private GameObject[] wallsPos;
// Custom func for Wall collapse
void WallDestruction ()
{
if (wallsPos == null )
{
wallsPos = GameObject.FindGameObjectsWithTag("Wall_Positive");
}
foreach (GameObject wallPos in wallsPos)
{
wallPos.transform.Rotate (Vector3.forward * 40 * Time.deltaTime);
}
}
void FixedUpdate ()
{
Invoke ("WallDestruction", 3f);
}
}
Comment