godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.55k stars 21.08k forks source link

Softbody does not update collision behaviour when collision masks/layers are changed at runtime #43243

Closed smix8 closed 3 years ago

smix8 commented 3 years ago

Godot version: 3.2.3.official, 3.2.4.beta1

OS/device including version: Win10 64x, GTX980

Issue description: Softbody mesh does not update collision behaviour when collision masks/layers are changed at runtime (inspector or script).

Both print() and remote inspector shows that all collision masks/layers on the softbody node are successfully enabled/disabled but the Softbody mesh still keeps colliding with objects on now disabled layers/masks or ignores objects with the now enabled layers/masks.

I notices this problem after implementing user settings for cloth simulation e.g. by disabling collision parts of a kinematic or rigid character for easier softbody calculation. While changes to "simulation_precision" and all other parameters on the softbody had the desired effects the changes on collision layers and masks did nothing. Only if the collision layers/mask on the colliding objects are also removed the softbody stops simulating them.

Steps to reproduce: Change collision masks/layers on a Softbody Node at runtime. Softbody ignores all changes and keeps collision settings from scene start.

Minimal reproduction project: Softbody Issue.zip

smix8 commented 3 years ago

Closed this until I can create a realiable Minimal reproduction project. The current was wrong and had me confused the layer inx from the layer bits. Still, even with the fixed numbers the softbody node half the time resists changes of its collision layerbit/maskbit at runtime compared to other physics nodes that use the same system and I can't pin it down why.