added UFO skywalk animation and bolt car teleport button

This commit is contained in:
2025-03-25 20:09:15 +02:00
parent 7ea187f9fd
commit e40106b45e
1036 changed files with 2552 additions and 43098 deletions

View File

@@ -0,0 +1,29 @@
using UnityEngine;
public class MoveInCircle : MonoBehaviour
{
[SerializeField] private float radius = 2f; // Radius of the circular movement
[SerializeField] private float speed = 2f; // Speed of circling
[SerializeField] private bool clockwise = true; // Direction toggle
private float angle = 0f; // Angle for movement
private Vector3 startLocalPosition;
void Start()
{
startLocalPosition = transform.localPosition; // Store the initial local position
}
void Update()
{
// Increment angle based on speed and direction
angle += (clockwise ? -1 : 1) * speed * Time.deltaTime;
// Calculate new local position
float x = Mathf.Cos(angle) * radius;
float z = Mathf.Sin(angle) * radius;
// Apply the new position relative to the parent
transform.localPosition = startLocalPosition + new Vector3(x, 0, z);
}
}