Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird physics behavior when using AddForce and changing scale of Solver
#5
(10-12-2020, 09:31 PM)josemendez Wrote: Hi,

The way you transform vectors from world space to local space in Unity is by using: https://docs.unity3d.com/ScriptReference...ector.html
Alright, so I tried doing this and scaling the force by the size to different degrees, but it seems to always exhibit the same behavior. For example, I tried squaring the force vector I plugged in and it still started reversing at around the same time (but at faster speeds).

This is what I changed the code to: 
Code:
_softbody.AddForce(_softbody.solver.transform.InverseTransformVector(Vector3.forward * _acceleration), ForceMode.Acceleration);
It is definitely scaling the vector, but the same behavior seems to happen. 

This is the behavior without scaling the force vector based on transform scale:

[Image: e69a6f32c208e117cf250e761d2f3435.gif]
And this is what happens when using the scaled force vector with the code above:

[Image: 12190ef4da170733ca185c87495d85e1.gif]

Should I be manipulating this force vector in some other way, or should I take another approach altogether?

Thanks again for the help!
Reply


Messages In This Thread
RE: Weird physics behavior when using AddForce and changing scale of Solver - by picross - 13-12-2020, 02:20 AM