Added custom CalculateForce
This commit is contained in:
parent
6c94ef65f8
commit
5e4d59d30a
@ -204,6 +204,13 @@ namespace Passer.Humanoid {
|
|||||||
return force;
|
return force;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector3 CalculateForce(Vector3 position, Vector3 targetPosition, bool damping = false) {
|
||||||
|
Vector3 force = (targetPosition - position) * handTarget.strength;
|
||||||
|
if (damping)
|
||||||
|
force += CalculateForceDamper();
|
||||||
|
return force;
|
||||||
|
}
|
||||||
|
|
||||||
private const float damping = 12;
|
private const float damping = 12;
|
||||||
private float lastDistanceTime;
|
private float lastDistanceTime;
|
||||||
private Vector3 lastDistanceToTarget;
|
private Vector3 lastDistanceToTarget;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user