I'm working on a VR game, that needs to have the Player go from one place SMOOTHLY to another, so I tried this code down below, and it Hard freezes the Unity Editor when I use it.
---
// Teleport target transform to ground position
public void Teleport()
{
if (groundDetected)
{
timer = 50f;
while (timer > 0)
{
bodyTransforn.position = Vector3.SmoothDamp(bodyTransforn.position, groundPos + lastNormal * 0.1f, ref velocityPh, travelS);
}
}
else
{
Debug.Log("Ground wasn't detected");
}
}
↧