Eda minigame but new branch

This commit is contained in:
2026-05-17 20:44:46 +02:00
parent dfec8df767
commit a15a9790b5
58 changed files with 1594 additions and 15 deletions

View File

@@ -0,0 +1,29 @@
using UnityEngine;
public class TeleportOnTrigger : MonoBehaviour
{
[Header("Teleport Target")]
public Transform targetPosition;
private void OnTriggerEnter(Collider other)
{
if (targetPosition == null) return;
Rigidbody rb = other.attachedRigidbody;
if (rb != null)
{
// STOP ALL MOTION
rb.linearVelocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
// TELEPORT
rb.position = targetPosition.position;
}
else
{
// Non-physics objects
other.transform.position = targetPosition.position;
}
}
}