Background music

This commit is contained in:
2024-04-21 18:56:14 +02:00
parent 1ab00c2b39
commit 2844bb2718
12 changed files with 157 additions and 7 deletions

View File

@@ -7,25 +7,22 @@ public class CarCustomizationCamera : MonoBehaviour
new Transform transform;
public Transform car;
public float rotateSpeed;
Vector3 startPosition;
Quaternion startRotation;
public Vector3 startPosition;
public Quaternion startRotation;
// Start is called before the first frame update
void Start()
{
transform = GetComponent<Transform>();
startPosition = transform.position;
startRotation = transform.rotation;
}
// Update is called once per frame
void Update()
{
transform.LookAt(car);
// transform.Translate(Vector3.right * Time.deltaTime);
transform.position += transform.right * Time.deltaTime * rotateSpeed;
}
private void OnEnable() {
transform = GetComponent<Transform>();
transform.position = startPosition;
transform.rotation = startRotation;
}