mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
Player Teleport Implemented
This commit is contained in:
parent
4c8cbcf82e
commit
610d8b832e
|
|
@ -166,6 +166,7 @@ public class dPlayerMovement : NetworkBehaviour
|
|||
g -= pStats.PlayerGrav * Time.deltaTime;
|
||||
rB.AddForce(new Vector3(0,g,0));
|
||||
}
|
||||
Respawn();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -373,7 +374,7 @@ public class dPlayerMovement : NetworkBehaviour
|
|||
{
|
||||
if (transform.position.y < -5)
|
||||
{
|
||||
transform.position = new Vector3(1f, 3f, 1f);
|
||||
TeleportPlayer(new Vector3(0,100,0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -575,8 +576,8 @@ public class dPlayerMovement : NetworkBehaviour
|
|||
moveController.enabled = true;
|
||||
}
|
||||
|
||||
|
||||
public void TeleportPlayer(){
|
||||
|
||||
public void TeleportPlayer(Vector3 position, Quaternion rotation = new Quaternion()){
|
||||
transform.position = position;
|
||||
transform.rotation = rotation;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -580,4 +580,9 @@ public class PlayerMovement : NetworkBehaviour
|
|||
}
|
||||
moveController.enabled = true;
|
||||
}
|
||||
|
||||
public void TeleportPlayer(Vector3 position, Quaternion rotation = new Quaternion()){
|
||||
transform.position = position;
|
||||
transform.rotation = rotation;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user