fix: Distributed Authority Sample - Jitter on FixedJoint connected body [MTT-9071] (#222)
different force application to locomotion fixing child joint jitter
This commit is contained in:
Родитель
a09b8eee22
Коммит
56845f95a7
|
@ -12,8 +12,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 48976c2ba473849eab61b8e1398b8644, type: 3}
|
||||
m_Name: AvatarPhysicsPlayerControllerSettings
|
||||
m_EditorClassIdentifier:
|
||||
WalkSpeed: 6
|
||||
SprintSpeed: 10
|
||||
WalkSpeed: 18
|
||||
SprintSpeed: 30
|
||||
Acceleration: 50
|
||||
DragCoefficient: 4
|
||||
AirControlFactor: 0.5
|
||||
|
|
|
@ -71,13 +71,13 @@ namespace Unity.Multiplayer.Samples.SocialHub.Physics
|
|||
{
|
||||
// Apply force proportional to acceleration while grounded
|
||||
var force = velocityChange * m_PhysicsPlayerControllerSettings.Acceleration;
|
||||
m_Rigidbody.AddForce(force, ForceMode.Acceleration);
|
||||
m_Rigidbody.AddForce(force, ForceMode.Force);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Apply reduced force in the air for air control
|
||||
var force = velocityChange * (m_PhysicsPlayerControllerSettings.Acceleration * m_PhysicsPlayerControllerSettings.AirControlFactor);
|
||||
m_Rigidbody.AddForce(force, ForceMode.Acceleration);
|
||||
m_Rigidbody.AddForce(force, ForceMode.Force);
|
||||
}
|
||||
|
||||
// maybe add magnitude check?
|
||||
|
|
Загрузка…
Ссылка в новой задаче