15 lines
480 B
C#
15 lines
480 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Axis5Z : MonoBehaviour
|
|
{
|
|
public void RotateAxis5Z(float targetRotationValue, float smooth)
|
|
{
|
|
// Rotate the cube by converting the angles into a quaternion.
|
|
Quaternion target = Quaternion.Euler(0, 0, targetRotationValue);
|
|
// Dampen towards the target rotation
|
|
transform.localRotation = Quaternion.Slerp(transform.rotation, target, smooth);
|
|
}
|
|
}
|