I’m experiencing a weird issue where the colliders are still active/repulsing objects even if the whole parent group is not.
This happens when dynamically disabling the parent through activeSelf = false removing the parent from the scene but not altering the children (which are not rendered anymore, as expected).
EDIT: I’ve realized the issue doesn’t occur when setting activeSelf = false but when it’s been removed through object.parent.remove(object).
Can you check if you still see the colliders when you add showcolliders to the url? Do you have a live link that you can share? And which version are you currently on?
Ah yeah - thanks for the report. I’ll take a look - it’s a known issue because we currently havent wrapped “add” and “remove” calls in threejs. It should also work correctly if you use GameObject.add or remove (our static method calls)
Oh indeed, using the static method the colliders are gone ! However I have now plenty of center.multiply is not a function errors.
At least now I know what the problem is. I’ll only disable the parents for this case instead of removing them.
Thanks for the help !
They occur while loading the game. For each instance created of some class attached to gameObjects, I check if its gameObject is active - if not, I remove it from the scene. Maybe the engine don’t like that we directly remove objects while it loads other ones.
The goal was to improve even more the performances - not rendering objects isn’t enough for big chunks of 3D models.
Just to update this from our PM: this seemed to be caused by calling GameObject.add(this.gameObject, this.parentObject) where the object was already visible and parented to that object. Unfortunately the same thing doesnt reproduce here for me - and works now in this case / with removing the duplicate call