public void TeleportPlayer(Transform where) { playerCamTarget_offset = playerCamTarget.position - player.position; Vector3 nearestGround; NearestGround.GetNearestGround(where.position, out nearestGround); player.position = nearestGround; playerCamTarget.position = nearestGround + playerCamTarget_offset; }
void Update() { foundGround = NearestGround.GetNearestGround(transform.position, out nearestGround); }