Files
Infratest/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs
T

23 lines
698 B
C#

using DG.Tweening;
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;
wheel.DOLocalRotate(wheelRotation, 1f);
// wheel.localRotation = Quaternion.Euler(wheelRotation);
}
}
}
}