mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Fixed NetworkTransforms and Added Host IP
- Fixed placement of NetworkTransform on Prefab - Needs to be on the same level as the character controller and movement - Added a display of the host IP address in the lobby
This commit is contained in:
@@ -165,11 +165,8 @@ public class PlayerMovement : NetworkBehaviour
|
||||
|
||||
//Checks if player should respawn
|
||||
Respawn();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Reads inputs and moves player
|
||||
private void InputController()
|
||||
{
|
||||
@@ -235,6 +232,8 @@ public class PlayerMovement : NetworkBehaviour
|
||||
//Applies impact in a direction with the given force
|
||||
public void AddImpact(Vector3 dir, float force)
|
||||
{
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
dir.Normalize();
|
||||
if (dir.y < 0) dir.y = -dir.y; // reflect down force on the ground
|
||||
impact += dir.normalized * force / mass;
|
||||
|
||||
Reference in New Issue
Block a user