0 votes

Hey all,

I am trying to temporary disable the collision shape (child) of a rigid body, then re-enabling it as suggested here, using:

mRigid.mode =  MODE_STATIC 
get_node("Collision-cube").disabled = true

and then

mRigid.mode =  MODE_RIGID 
get_node("Collision-cube").disabled = false

This works well for a while, then suddenly, when more objects are created, some collision are not detected anymore... (tried using CCD, can_sleep = false, sleeping = false...not to avail)

Any specific rule I should respect when toggling off/on collision shape ?

Thx

asked Feb 23, 2019 in Engine by GameVisitor (834 points)
retagged Feb 24, 2019 by GameVisitor

I noticed this happens after reloading my scene (my game reloads the main scene indefinitely with random parameters).

I also noticed that my objects are not "pickable" anymore:

func _input_event(camera, event, pos, normal, shape):

callback not being called anymore.
Also found this error in Android logcat, that i am feel is related to my problem but can't figure it out...

02-24 09:44:03.017 17885 17933 I GLSurfaceView: OpenGL:org.godotengine.mygame Skipped 58 frames!
02-24 09:44:03.575 17885 17933 I GLSurfaceView: OpenGL:org.godotengine.mygame Skipped 33 frames!

Thanks for any advice I can get :-)

1 Answer

0 votes

I couldn't find exactly the problem, except that I used a backup-ed copy of my scene and the problem went away. I am sure that the issue is not related to my gd script since using the same script with the old scene made the bug disappeared.

answered Mar 3, 2019 by GameVisitor (834 points)
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 How to use this Q&A? before posting your first questions.