Problem with TRigidBody

Hi there,

I tried to replace SceneAvatar.Gravity := true; because it is deprecated.
I have made one Rigidbody for the Level and one for the Avatar.
If AvatarBody.Dynamic:=false; I can see no gravity!
If AvatarBody.Dynamic:=true; it looks like gravity is OK, but I’m not able to move the Avatar.
In the documentation I have found this:

In this case you cannot
change the @link(TCastleTransform.Translation) and other
transformation properties of the related TCastleTransform
after assigning @link(TCastleTransform.RigidBody).
They are under the control of the physics engine.
You can still reliably read them.

Is there an other or better way to do? The old simple physics work good for me.
Or do I something wrong?

Thanks in advance

There’s a lot of update to it in the “physics” branch GitHub - castle-engine/castle-engine at physics . We should merge it (PR should be next week) – moving around using physics in third_person_navigation really works there.

In the meantime, with CGE master, I would say that you can stay using old physics. In this case, although SceneAvatar.Gravity is deprecated, we don’t (yet) have a perfect replacement for it (in CGE master). We try to avoid that (in general if something is deprecated, we have a better replacement for it), but in this case we don’t (yet) :slight_smile:

Here’s a screenshot of it working, with physics, on new physics branch :slight_smile: To be merged to master soon, watch out for news!

1 Like