I have a script that will rotate my object in the X axis. I need it to rotate on the Z axis instead and i cant figure out how to do that.
using UnityEngine;
using System.Collections;
public class TextSpin : MonoBehaviour
{
public float _Angle;
public float _Period;
private float _Time;
// Update is called once per frame
void Update()
{
_Time = _Time + Time.deltaTime;
float phase = Mathf.Sin(_Time / _Period);
transform.localRotation = Quaternion.Euler(new Vector3(0, phase * _Angle, 0));
}
}
Thanks in advance!