Compare commits
2 Commits
1e7dc01762
...
e75e412d10
| Author | SHA1 | Date | |
|---|---|---|---|
| e75e412d10 | |||
| 156571e376 |
@ -455,7 +455,7 @@ namespace Passer.Humanoid {
|
||||
AddTrackedRigidbody(trackedRigidbody);
|
||||
}
|
||||
|
||||
if (humanoid.physics && grabbedRigidbody)
|
||||
if (this.physics && grabbedRigidbody)
|
||||
AdvancedHandPhysics.SetNonKinematic(handRigidbody, colliders);
|
||||
|
||||
// This does not work in the editor, so controller input cannot be set this way
|
||||
@ -796,7 +796,7 @@ namespace Passer.Humanoid {
|
||||
Object.DontDestroyOnLoad(grabbedObject);
|
||||
}
|
||||
|
||||
if (humanoid.physics)
|
||||
if (this.physics)
|
||||
AdvancedHandPhysics.SetNonKinematic(handRigidbody, colliders);
|
||||
|
||||
if (grabbedRigidbody)
|
||||
|
||||
@ -204,13 +204,13 @@ namespace Passer {
|
||||
return force;
|
||||
}
|
||||
|
||||
public static Vector3 CalculateForce(Rigidbody thisRigidbody, Vector3 sollPosition, float strength, float damping = 1500) {
|
||||
public static Vector3 CalculateForce(Rigidbody thisRigidbody, Vector3 sollPosition, float strength, float damping = 25) {
|
||||
Vector3 locationDifference = sollPosition - thisRigidbody.position;
|
||||
Vector3 force = locationDifference;
|
||||
|
||||
//force += CalculateForceDamper();
|
||||
//Vector3 damper = -thisRigidbody.velocity * Time.deltaTime * damping;
|
||||
//force += damper;
|
||||
Vector3 damper = -thisRigidbody.velocity * Time.deltaTime * damping;
|
||||
force += damper;
|
||||
return force * strength;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user