0 votes

Hello,

I have a RigidBody node I'd like to simulate translational movements only. So I've locked the rotational degrees of freedom using 3 appropriate check boxes. The problem is it seems I can't change orientation anyhow without freezing the node movement. For example, I'd like to change the body orientation in the following way.

var t: Transform = self.transform
t.basis = _q # "_q" is computed in other place
self.transform = t

The body freezes in space. I.e. it rotates the way I rotate it but all physics gets disabled.

And it doesn't matter if I change transform at all. Even a simple

self.transform = self.transform 

Freezes the body movements. It just stays in place as if it was a static body.

Is there any way to change rigid body orientation and keep physics simulation running? I find it a little bit confusing that assigning a transform even its own value stops the simulation.

Further testing showed that the assignment disables simulation for this exact frame. For example, if "self.transform = self.transform" is called once, only one frame is not simulated. But if it is called inside _process(delta), (i.e. for every frame), the body movement stops completely.

in Engine by (43 points)

1 Answer

0 votes
Best answer
by (4,084 points)
selected by

Thanks a lot!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.