Improve touch stability
This commit is contained in:
parent
1e7dc01762
commit
156571e376
@ -204,13 +204,13 @@ namespace Passer {
|
|||||||
return force;
|
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 locationDifference = sollPosition - thisRigidbody.position;
|
||||||
Vector3 force = locationDifference;
|
Vector3 force = locationDifference;
|
||||||
|
|
||||||
//force += CalculateForceDamper();
|
//force += CalculateForceDamper();
|
||||||
//Vector3 damper = -thisRigidbody.velocity * Time.deltaTime * damping;
|
Vector3 damper = -thisRigidbody.velocity * Time.deltaTime * damping;
|
||||||
//force += damper;
|
force += damper;
|
||||||
return force * strength;
|
return force * strength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user