You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PhysicsMaterials applied to bodies through the physics_material_override are not applied if they are created before assigning a collision_mask or collision_layer. They work properly if they are defined after setting collision_mask or collision_layer.
To Reproduce
Define the physics_material_override in code like such:
then set the collision_mask or collision_layer property to anything:
collision_layer = 1
collision_mask = 1
and the materials are now ignored.
Expected behavior
Regardless of when the PhysicsMaterial is defined in code, the body should reflect it. If collision_layer or collision_mask is updated it shouldn't have any bearing on the material.
TrevorPeyton
changed the title
PhysicsMaterials are not applied
PhysicsMaterials not applied if collision_mask is changed
Oct 25, 2024
TrevorPeyton
changed the title
PhysicsMaterials not applied if collision_mask is changed
PhysicsMaterials not applied if collision_mask or collision_layer is changed
Oct 25, 2024
TrevorPeyton
changed the title
PhysicsMaterials not applied if collision_mask or collision_layer is changed
RigidBody2D PhysicsMaterials not applied if collision_mask or collision_layer is changed
Oct 25, 2024
Describe the bug
PhysicsMaterials applied to bodies through the physics_material_override are not applied if they are created before assigning a collision_mask or collision_layer. They work properly if they are defined after setting collision_mask or collision_layer.
To Reproduce
Define the physics_material_override in code like such:
then set the collision_mask or collision_layer property to anything:
and the materials are now ignored.
Expected behavior
Regardless of when the PhysicsMaterial is defined in code, the body should reflect it. If collision_layer or collision_mask is updated it shouldn't have any bearing on the material.
Environment:
Example project(zip)
physicsmaterialissue.zip
The text was updated successfully, but these errors were encountered: