Click or drag to resize

KinematicBody2DMoveAndCollide Method

Moves the body along the vector rel_vec. The body will stop if it collides. Returns a KinematicCollision2D, which contains information about the collision.

If test_only is true, the body does not move but the would-be collision information is given.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public KinematicCollision2D MoveAndCollide(
	Vector2 relVec,
	bool infiniteInertia = true,
	bool excludeRaycastShapes = true,
	bool testOnly = false
)

Parameters

relVec
Type: GodotVector2

[Missing <param name="relVec"/> documentation for "M:Godot.KinematicBody2D.MoveAndCollide(Godot.Vector2,System.Boolean,System.Boolean,System.Boolean)"]

infiniteInertia (Optional)
Type: SystemBoolean

[Missing <param name="infiniteInertia"/> documentation for "M:Godot.KinematicBody2D.MoveAndCollide(Godot.Vector2,System.Boolean,System.Boolean,System.Boolean)"]

excludeRaycastShapes (Optional)
Type: SystemBoolean

[Missing <param name="excludeRaycastShapes"/> documentation for "M:Godot.KinematicBody2D.MoveAndCollide(Godot.Vector2,System.Boolean,System.Boolean,System.Boolean)"]

testOnly (Optional)
Type: SystemBoolean

[Missing <param name="testOnly"/> documentation for "M:Godot.KinematicBody2D.MoveAndCollide(Godot.Vector2,System.Boolean,System.Boolean,System.Boolean)"]

Return Value

Type: KinematicCollision2D

[Missing <returns> documentation for "M:Godot.KinematicBody2D.MoveAndCollide(Godot.Vector2,System.Boolean,System.Boolean,System.Boolean)"]

See Also