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:
2021-11-03 14:03:43 -05:00
parent a47550e85b
commit 2953687180
14 changed files with 252 additions and 466 deletions

View File

@@ -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;