In AiBase.cs of free version "var UseGravity" doesn't accurately represent rigidbody's gravity setting


#1

Could be wrong but to me it looks the UseGravity variable in AiBase.cs of free versiondoesn’t accurately correspond to rigidbodies gravity settings.

Original on lines 317 and 616 of AiBase.cs
usingGravity = !(gravity == Vector3.zero) && (!updatePosition || ((rigid == null || rigid.isKinematic) && (rigid2D == null || rigid2D.isKinematic)));
Proposed change:
usingGravity = !(gravity == Vector3.zero) && (!updatePosition || (rigid == null || (!rigid.isKinematic && rigid.useGravity)) && (rigid2D == null || (!rigid2D.isKinematic)));

Amazing tool btw!


#2

Hi

The usingGravity boolean in the AIBase script indicates if the movement script should apply its own gravity. If the rigidbody is non-kinematic the movement script leaves gravity to be handled by the rigidbody itself instead.


#3

Also about gravity. At the moment the latest beta doesn’t apply GravityScale from the RigidBody to the Physics.Gravity setting.


#4

Hi

If you want the rigidbody to control gravity then just mark the rigidbody as non-kinematic. Otherwise the movement script is in control over the gravity, which is completely separate from the rigidbody settings.


#5

Hi,

Thank for the answer, Aron. That behavior is just confusing a bit, because this multiplier is affecting dynamic rigitbodies too.