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/Axis1Y.cs
2025-03-04 10:13:12 +09:00

19 lines
569 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Axis1Y : MonoBehaviour
{
public void RotateAxis1Y(float targetRotationValue, float smooth)
{
// Rotate the cube by converting the angles into a quaternion.
Quaternion target = Quaternion.Euler(0, targetRotationValue, 0);
// Dampen towards the target rotation
transform.localRotation = Quaternion.Slerp(transform.rotation, target, smooth);
//transform.Rotate(new Vector3(0, targetRotationValue * Time.deltaTime, 0));
}
}