MeshyAnimatablePhysicsSettings
Inherits Resource.
Physics settings for generated collision geometry moved by animations or scripts.
Properties
Section titled “Properties”approximation_tolerance
Section titled “approximation_tolerance”approximation_tolerance: float = 0.02setter: set_approximation_tolerance; getter: get_approximation_tolerance.
The allowed error for convex decomposition, as a dimensionless ratio. Limits relative excess volume and surface deviation divided by the longest bounding-box dimension. A value of 0.02 allows 2% error in each measure.
Lower values require a closer approximation and may require more convex shapes. Generation fails if max_hulls prevents the requested tolerance from being met.
axis_lock_angular_x
Section titled “axis_lock_angular_x”axis_lock_angular_x: bool = falsesetter: set_axis_lock_angular_x; getter: get_axis_lock_angular_x.
Lock the body’s rotation in the X axis.
axis_lock_angular_y
Section titled “axis_lock_angular_y”axis_lock_angular_y: bool = falsesetter: set_axis_lock_angular_y; getter: get_axis_lock_angular_y.
Lock the body’s rotation in the Y axis.
axis_lock_angular_z
Section titled “axis_lock_angular_z”axis_lock_angular_z: bool = falsesetter: set_axis_lock_angular_z; getter: get_axis_lock_angular_z.
Lock the body’s rotation in the Z axis.
axis_lock_linear_x
Section titled “axis_lock_linear_x”axis_lock_linear_x: bool = falsesetter: set_axis_lock_linear_x; getter: get_axis_lock_linear_x.
Lock the body’s linear movement in the X axis.
axis_lock_linear_y
Section titled “axis_lock_linear_y”axis_lock_linear_y: bool = falsesetter: set_axis_lock_linear_y; getter: get_axis_lock_linear_y.
Lock the body’s linear movement in the Y axis.
axis_lock_linear_z
Section titled “axis_lock_linear_z”axis_lock_linear_z: bool = falsesetter: set_axis_lock_linear_z; getter: get_axis_lock_linear_z.
Lock the body’s linear movement in the Z axis.
collision_layer
Section titled “collision_layer”collision_layer: int = 1setter: set_collision_layer; getter: get_collision_layer.
The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also collision_mask.
Note: Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See Collision layers and masks in the documentation for more information.
collision_mask
Section titled “collision_mask”collision_mask: int = 1setter: set_collision_mask; getter: get_collision_mask.
The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also collision_layer.
Note: Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See Collision layers and masks in the documentation for more information.
collision_priority
Section titled “collision_priority”collision_priority: float = 1.0setter: set_collision_priority; getter: get_collision_priority.
The priority used to solve colliding when occurring penetration. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level.
constant_angular_velocity
Section titled “constant_angular_velocity”constant_angular_velocity: Vector3 = Vector3(0, 0, 0)setter: set_constant_angular_velocity; getter: get_constant_angular_velocity.
The body’s constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating.
constant_linear_velocity
Section titled “constant_linear_velocity”constant_linear_velocity: Vector3 = Vector3(0, 0, 0)setter: set_constant_linear_velocity; getter: get_constant_linear_velocity.
The body’s constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving.
debug_color
Section titled “debug_color”debug_color: Color = Color(0, 0.6, 0.7, 0.42)setter: set_debug_color; getter: get_debug_color.
The collision shape color that is displayed in the editor, or in the running project if Debug > Visible Collision Shapes is checked at the top of the editor.
Note: The default value is ProjectSettings.debug/shapes/collision/shape_color. The Color(0, 0, 0, 0) value documented here is a placeholder, and not the actual default debug color.
debug_fill
Section titled “debug_fill”debug_fill: bool = truesetter: set_debug_fill; getter: get_debug_fill.
If true, when the shape is displayed, it will show a solid fill color in addition to its wireframe.
max_hulls
Section titled “max_hulls”max_hulls: int = 32setter: set_max_hulls; getter: get_max_hulls.
The maximum number of convex shapes generated when shape_mode is Convex - Multiple. Accepted values range from 1 to 256.
A higher limit can preserve more detail at a higher physics cost. If this limit prevents generation from meeting approximation_tolerance, generation fails and no live collider is created.
physics_material_override
Section titled “physics_material_override”physics_material_override: PhysicsMaterial = nullsetter: set_physics_material_override; getter: get_physics_material_override.
The physics material override for the body.
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
resource_local_to_scene
Section titled “resource_local_to_scene”resource_local_to_scene: bool = truesetter: set_local_to_scene; getter: is_local_to_scene.
shape_mode
Section titled “shape_mode”shape_mode: int = 0setter: set_shape_mode; getter: get_shape_mode.
Selects the collision shapes generated from the mesh.
Auto uses one convex hull for closed, outward-facing convex geometry. Otherwise, it uses concave shapes per surface, preserving face winding.
Concave is available only for static and animatable bodies. Convex - Single uses one convex shape and fills openings and cavities. Convex - Multiple approximates a closed solid with multiple convex shapes.
sync_to_physics
Section titled “sync_to_physics”sync_to_physics: bool = truesetter: set_sync_to_physics; getter: get_sync_to_physics.
If true, the body’s movement will be synchronized to the physics frame. This is useful when animating movement via AnimationPlayer, for example on moving platforms. Do not use together with PhysicsBody3D.move_and_collide.
Methods
Section titled “Methods”generation_identity
Section titled “generation_identity”generation_identity() -> Stringqualifiers: const.
get_mode
Section titled “get_mode”get_mode() -> intqualifiers: const.
material_changed
Section titled “material_changed”material_changed() -> void