Click or drag to resize

Physics2DServerBodyTestMotion Method

Returns true if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. Physics2DTestMotionResult can be passed to return additional information in.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static bool BodyTestMotion(
	RID body,
	Transform2D from,
	Vector2 motion,
	bool infiniteInertia,
	float margin = 0.08f,
	Physics2DTestMotionResult result = null
)

Parameters

body
Type: GodotRID

[Missing <param name="body"/> documentation for "M:Godot.Physics2DServer.BodyTestMotion(Godot.RID,Godot.Transform2D,Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

from
Type: GodotTransform2D

[Missing <param name="from"/> documentation for "M:Godot.Physics2DServer.BodyTestMotion(Godot.RID,Godot.Transform2D,Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

motion
Type: GodotVector2

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

infiniteInertia
Type: SystemBoolean

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

margin (Optional)
Type: SystemSingle

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

result (Optional)
Type: GodotPhysics2DTestMotionResult

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

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Godot.Physics2DServer.BodyTestMotion(Godot.RID,Godot.Transform2D,Godot.Vector2,System.Boolean,System.Single,Godot.Physics2DTestMotionResult)"]

See Also