Files
Infratest/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs
T
2026-02-26 11:57:51 +03:00

23 lines
703 B
C#

using PrimeTween;
using UnityEngine;
namespace Code.Example.Race.Racer.Car
{
public class CarWheelRotatorPlayer : MonoBehaviour
{
[SerializeField] private Transform[] wheels;
[SerializeField] private bool rotateDebug;
public void RotateWheels(float amount)
{
// UnityEngine.Debug.Log("Rotating Wheels: " + amount);
foreach (var wheel in wheels)
{
var wheelRotation = wheel.localRotation.eulerAngles;
wheelRotation.y = amount;
Tween.LocalRotation(wheel,wheelRotation, 1f);
// wheel.localRotation = Quaternion.Euler(wheelRotation);
}
}
}
}