Skip to main content

manage_physics

Auto-generated from the Python tool registry. Do not hand-edit outside <!-- examples:start --><!-- examples:end --> blocks — the generator (tools/generate_docs_reference.py) will overwrite them.

Group: core  ·  Module: services.tools.manage_physics

Description​

Manage physics settings, collision matrix, materials, joints, queries, and validation.

SETTINGS: ping, get_settings, set_settings COLLISION MATRIX: get_collision_matrix, set_collision_matrix MATERIALS: create_physics_material, configure_physics_material, assign_physics_material JOINTS: add_joint, configure_joint, remove_joint QUERIES: raycast, raycast_all, linecast, shapecast, overlap FORCES: apply_force RIGIDBODY: get_rigidbody, configure_rigidbody VALIDATION: validate SIMULATION: simulate_step

Parameters​

NameTypeRequiredDescription
actionLiteral['ping', 'get_settings', 'set_settings', 'get_collision_matrix', 'set_collision_matrix', 'create_physics_material', 'configure_physics_material', 'assign_physics_material', 'add_joint', 'configure_joint', 'remove_joint', 'raycast', 'raycast_all', 'linecast', 'shapecast', 'overlap', 'validate', 'simulate_step', 'apply_force', 'get_rigidbody', 'configure_rigidbody']yesThe physics action to perform.
dimensionstr | None—Physics dimension: '3d' (default) or '2d'.
settingsdict[str, Any] | None—Key-value settings for set_settings.
layer_astr | None—Layer name or index for collision matrix.
layer_bstr | None—Layer name or index for collision matrix.
collidebool | None—Whether layers should collide (set_collision_matrix).
namestr | None—Name for new physics material.
pathstr | None—Asset path for materials.
dynamic_frictionfloat | None—Dynamic friction (0-1).
static_frictionfloat | None—Static friction (0-1).
bouncinessfloat | None—Bounciness (0-1).
frictionfloat | None—Friction for 2D materials.
friction_combinestr | None—Friction combine mode: Average, Minimum, Multiply, Maximum.
bounce_combinestr | None—Bounce combine mode: Average, Minimum, Multiply, Maximum.
material_pathstr | None—Path to physics material asset for assign.
targetstr | None—Target GameObject name or instance ID.
collider_typestr | None—Specific collider type to target.
search_methodstr | None—Search method for target resolution.
joint_typestr | None—Joint type: fixed, hinge, spring, character, configurable (3D); distance, fixed, friction, hinge, relative, slider, spring, target, wheel (2D).
connected_bodystr | None—Connected body target for joints.
motordict[str, Any] | None—Motor config: {targetVelocity, force, freeSpin}.
limitsdict[str, Any] | None—Limits config: {min, max, bounciness}.
springdict[str, Any] | None—Spring config: {spring, damper, targetPosition}.
drivedict[str, Any] | None—Drive config for ConfigurableJoint.
propertiesdict[str, Any] | None—Direct property dict for joints or materials.
originlist[float] | None—Ray origin [x,y,z] or [x,y].
directionlist[float] | None—Ray direction [x,y,z] or [x,y].
max_distancefloat | None—Max raycast distance.
layer_maskstr | None—Layer mask for queries (name or int).
query_trigger_interactionstr | None—Trigger interaction: UseGlobal, Ignore, Collide.
shapestr | None—Overlap shape: sphere, box, capsule (3D); circle, box, capsule (2D).
positionlist[float] | None—Overlap position [x,y,z] or [x,y].
sizeAny | None—Overlap size: float (radius) or [x,y,z] (half-extents).
startlist[float] | None—Linecast start point [x,y,z] or [x,y].
endlist[float] | None—Linecast end point [x,y,z] or [x,y].
point1list[float] | None—Capsule shapecast point1 [x,y,z].
point2list[float] | None—Capsule shapecast point2 [x,y,z].
heightfloat | None—Capsule height for shapecast.
capsule_directionint | None—Capsule direction: 0=X, 1=Y (default), 2=Z.
anglefloat | None—Rotation angle for 2D shape casts.
forcelist[float] | None—Force vector [x,y,z] or [x,y] for apply_force.
force_modestr | None—Force mode: Force, Impulse, Acceleration, VelocityChange (3D); Force, Impulse (2D).
force_typestr | None—Force type: 'normal' (default) or 'explosion' (3D only).
torquelist[float] | None—Torque vector [x,y,z] (3D) or [z] (2D).
explosion_positionlist[float] | None—Explosion center [x,y,z].
explosion_radiusfloat | None—Explosion radius.
explosion_forcefloat | None—Explosion force magnitude.
upwards_modifierfloat | None—Explosion upwards modifier.
stepsint | None—Number of simulation steps (max 100).
step_sizefloat | None—Step size in seconds.
page_sizeint | None—Page size for validate results (default 50).
cursorint | None—Cursor offset for validate pagination.
component_indexint | None—Zero-based index to select which component when multiple of the same type exist (e.g., multiple HingeJoints or BoxColliders). If omitted, targets the first instance.

Returns​

A dict containing the Unity response. The exact shape depends on the action.

Examples​

No examples yet. Add usage examples here — they will be preserved across regenerations.