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 ?


in Engine by (892 points)
retagged by

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.

by (892 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 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.