Click or drag to resize

RigidBody2DTestMotion Method

Returns true if a collision would result from moving in the given vector. margin increases the size of the shapes involved in the collision detection, and result is an object of type Physics2DTestMotionResult, which contains additional information about the collision (should there be one).

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public bool TestMotion(
	Vector2 motion,
	bool infiniteInertia = true,
	float margin = 0.08f,
	Physics2DTestMotionResult result = null
)

Parameters

motion
Type: GodotVector2

[Missing <param name="motion"/> documentation for "M:Godot.RigidBody2D.TestMotion(Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

infiniteInertia (Optional)
Type: SystemBoolean

[Missing <param name="infiniteInertia"/> documentation for "M:Godot.RigidBody2D.TestMotion(Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

margin (Optional)
Type: SystemSingle

[Missing <param name="margin"/> documentation for "M:Godot.RigidBody2D.TestMotion(Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

result (Optional)
Type: GodotPhysics2DTestMotionResult

[Missing <param name="result"/> documentation for "M:Godot.RigidBody2D.TestMotion(Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Godot.RigidBody2D.TestMotion(Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

See Also