Skip to content

MeshyStaticPhysicsSettings

Inherits Resource.

Class index

Physics settings for generated collision geometry that remains fixed in place.

approximation_tolerance: float = 0.02

setter: 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: bool = false

setter: set_axis_lock_angular_x; getter: get_axis_lock_angular_x.

Lock the body’s rotation in the X axis.

axis_lock_angular_y: bool = false

setter: set_axis_lock_angular_y; getter: get_axis_lock_angular_y.

Lock the body’s rotation in the Y axis.

axis_lock_angular_z: bool = false

setter: set_axis_lock_angular_z; getter: get_axis_lock_angular_z.

Lock the body’s rotation in the Z axis.

axis_lock_linear_x: bool = false

setter: 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: bool = false

setter: 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: bool = false

setter: set_axis_lock_linear_z; getter: get_axis_lock_linear_z.

Lock the body’s linear movement in the Z axis.

collision_layer: int = 1

setter: 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: int = 1

setter: 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: float = 1.0

setter: 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: 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: 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: 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: bool = true

setter: 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: int = 32

setter: 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: PhysicsMaterial = null

setter: 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: bool = true

setter: set_local_to_scene; getter: is_local_to_scene.

shape_mode: int = 0

setter: 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.

generation_identity() -> String

qualifiers: const.

get_mode() -> int

qualifiers: const.

material_changed() -> void