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 | NonePhysics dimension: '3d' (default) or '2d'.
settingsdict[str, Any] | NoneKey-value settings for set_settings.
layer_astr | NoneLayer name or index for collision matrix.
layer_bstr | NoneLayer name or index for collision matrix.
collidebool | NoneWhether layers should collide (set_collision_matrix).
namestr | NoneName for new physics material.
pathstr | NoneAsset path for materials.
dynamic_frictionfloat | NoneDynamic friction (0-1).
static_frictionfloat | NoneStatic friction (0-1).
bouncinessfloat | NoneBounciness (0-1).
frictionfloat | NoneFriction for 2D materials.
friction_combinestr | NoneFriction combine mode: Average, Minimum, Multiply, Maximum.
bounce_combinestr | NoneBounce combine mode: Average, Minimum, Multiply, Maximum.
material_pathstr | NonePath to physics material asset for assign.
targetstr | NoneTarget GameObject name or instance ID.
collider_typestr | NoneSpecific collider type to target.
search_methodstr | NoneSearch method for target resolution.
joint_typestr | NoneJoint type: fixed, hinge, spring, character, configurable (3D); distance, fixed, friction, hinge, relative, slider, spring, target, wheel (2D).
connected_bodystr | NoneConnected body target for joints.
motordict[str, Any] | NoneMotor config: {targetVelocity, force, freeSpin}.
limitsdict[str, Any] | NoneLimits config: {min, max, bounciness}.
springdict[str, Any] | NoneSpring config: {spring, damper, targetPosition}.
drivedict[str, Any] | NoneDrive config for ConfigurableJoint.
propertiesdict[str, Any] | NoneDirect property dict for joints or materials.
originlist[float] | NoneRay origin [x,y,z] or [x,y].
directionlist[float] | NoneRay direction [x,y,z] or [x,y].
max_distancefloat | NoneMax raycast distance.
layer_maskstr | NoneLayer mask for queries (name or int).
query_trigger_interactionstr | NoneTrigger interaction: UseGlobal, Ignore, Collide.
shapestr | NoneOverlap shape: sphere, box, capsule (3D); circle, box, capsule (2D).
positionlist[float] | NoneOverlap position [x,y,z] or [x,y].
sizeAny | NoneOverlap size: float (radius) or [x,y,z] (half-extents).
startlist[float] | NoneLinecast start point [x,y,z] or [x,y].
endlist[float] | NoneLinecast end point [x,y,z] or [x,y].
point1list[float] | NoneCapsule shapecast point1 [x,y,z].
point2list[float] | NoneCapsule shapecast point2 [x,y,z].
heightfloat | NoneCapsule height for shapecast.
capsule_directionint | NoneCapsule direction: 0=X, 1=Y (default), 2=Z.
anglefloat | NoneRotation angle for 2D shape casts.
forcelist[float] | NoneForce vector [x,y,z] or [x,y] for apply_force.
force_modestr | NoneForce mode: Force, Impulse, Acceleration, VelocityChange (3D); Force, Impulse (2D).
force_typestr | NoneForce type: 'normal' (default) or 'explosion' (3D only).
torquelist[float] | NoneTorque vector [x,y,z] (3D) or [z] (2D).
explosion_positionlist[float] | NoneExplosion center [x,y,z].
explosion_radiusfloat | NoneExplosion radius.
explosion_forcefloat | NoneExplosion force magnitude.
upwards_modifierfloat | NoneExplosion upwards modifier.
stepsint | NoneNumber of simulation steps (max 100).
step_sizefloat | NoneStep size in seconds.
page_sizeint | NonePage size for validate results (default 50).
cursorint | NoneCursor offset for validate pagination.
component_indexint | NoneZero-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.