Hässliche reuden ranz Map-Begrenzung

This commit is contained in:
Simon Lübeß
2024-04-08 16:43:05 +02:00
parent 8e995ec0a5
commit 739eb2bc4b
550 changed files with 108099 additions and 7582 deletions

View File

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LPPV_CarRotation : MonoBehaviour {
private float targetAngle;
private float vel;
private float smoothSpeed = 10f;
private void Start ()
{
if (transform.localEulerAngles.y > 0)
{
targetAngle = 25f + transform.localEulerAngles.y;
}else
{
targetAngle = -25f - transform.localEulerAngles.y;
}
}
private void FixedUpdate ()
{
Quaternion target = Quaternion.Euler (new Vector3(transform.localEulerAngles.x, targetAngle, transform.localEulerAngles.z));
transform.rotation = Quaternion.Slerp (transform.rotation, target, Time.deltaTime * smoothSpeed);
if (targetAngle > 0)
targetAngle++;
else
targetAngle--;
}
}