Skip to content

Commit

Permalink
send only the current wheel state, and prevent memory leak bug in Mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
in0finite committed May 31, 2020
1 parent 626567e commit a6713c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Assets/Scripts/Behaviours/Vehicles/VehicleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void ProcessSyncvars()
m_net_angularVelocity = m_vehicle.RigidBody.angularVelocity;

// wheels
m_net_wheelsData.Flush(); // remove current list of changes - this ensures that only the current wheel state is sent, and prevents memory leak bug in Mirror
m_net_wheelsData.Clear();
foreach (var wheel in m_vehicle.Wheels) {
m_net_wheelsData.Add(new WheelSyncData() {
Expand Down

0 comments on commit a6713c2

Please sign in to comment.