#Removing Rigidbody Constraints

1 messages · Page 1 of 1 (latest)

frozen rain
hard cargo
#

On the DragControls you could register via addDragEventListener to drag end and drive the rigidbody contraints there 👍

light prairie
#

It looks like the rigidbodies are sleeping/not waking up after drag ends 🤔

light prairie
#

You can try to call wakeUp on the Rigidbody via the addDragEventListener as suggested to test if that's the problem

frozen rain
little abyss
#

do they have a rotation constraint? looks like they always keep their orientation.

frozen rain
#

In Unity, they have no constraints activated. The center of mass is set okay, I'm thinking that something applies a rotation constraint when I lift them?

hard cargo
#

Hm, it doesn't seem to.

It also seems, that there is a interface IDragEventListener which you can implement in your script, there you can

console.log(this.gameObject.getComponent(Rigidbody))
#

And see the state of the rigidbody

frozen rain
#

I've tried what you recommended yesterday, but it worked just one time. After that there was no chance to find where to put that line again, so it will display something when I press the play button. Unfortunately, I can't manage to make any kind of code to work inside DragControls.ts. I was trying also to add some angular motion to the objects, without succeeding. Any ideas why it doesn't want to work?

light prairie
#

I think it also just uses drag controls without custom code. Perhaps you can take a look at this one again and compare with your scene?

frozen rain
#

Eventually, I managed to make it work. It was about box colliders and physics material. I had mesh colliders and for some reason it didn't want to work. Thank you all!

hard cargo
#

Mesh collider on the object or on the map?

Glad that you figured it out 👍

frozen rain
#

On the objects. For the map I used box colliders from the beginning.