Add project files.

This commit is contained in:
2026-09-26 00:08:05 +02:00
parent 499699f7c8
commit adca4d9167
10 changed files with 1055 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
using UnityEngine;
namespace MSCO
{
/// <summary>Bewegt den anderen Spieler weich zur zuletzt empfangenen Position.</summary>
public class RemotePlayer : MonoBehaviour
{
Vector3 targetPos;
float targetRotY;
public void SetTarget(PlayerState state)
{
targetPos = state.Position;
targetRotY = state.RotationY;
}
public void Tick(float dt)
{
// Bei großen Sprüngen (Teleport, Laden) direkt setzen statt gleiten
if ((transform.position - targetPos).sqrMagnitude > 100f)
transform.position = targetPos;
else
transform.position = Vector3.Lerp(transform.position, targetPos, dt * 15f);
transform.rotation = Quaternion.Slerp(transform.rotation,
Quaternion.Euler(0f, targetRotY, 0f), dt * 15f);
}
}
}