Skip to content

Commit

Permalink
Merge pull request #74 from fragmental/playtestfixes
Browse files Browse the repository at this point in the history
hopefully fixes a few errors in online multiplayer
  • Loading branch information
Cheeseness authored Apr 24, 2017
2 parents da91a42 + 8be5dcb commit c120753
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Assets/scripts/entity/Ball.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ private void FixedUpdate()

if (rigidBody.velocity.magnitude < minimumVelocity)
{
rigidBody.velocity *= minimumVelocity / rigidBody.velocity.magnitude;
//added a ver small number to keep from dividing by zero
rigidBody.velocity *= minimumVelocity / rigidBody.velocity.magnitude + 0.000000001F;
}
if (rigidBody.velocity.magnitude > maximumVelocity)
{
rigidBody.velocity *= maximumVelocity / rigidBody.velocity.magnitude;
//added a ver small number to keep from dividing by zero
rigidBody.velocity *= maximumVelocity / rigidBody.velocity.magnitude + 0.000000001F;
}
}

Expand Down Expand Up @@ -105,6 +107,9 @@ void OnTriggerEnter(Collider Col)

void OnCollisionExit(Collision other)
{
// Only handle ball force server-side of local
if (NetworkManager.singleton.isNetworkActive && NetworkServer.connections.Count == 0) return;

if (other.gameObject.tag == "Paddle" ||
other.gameObject.tag == "Bumper")
{
Expand Down

0 comments on commit c120753

Please sign in to comment.