This repository has been archived on 2026-01-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AW_2025/Assets/Scripts/Axis5Z.cs
2025-03-04 10:13:12 +09:00

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);
}
}