Click or drag to resize

Physics2DDirectSpaceStateIntersectPoint Method

Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:

collider: The colliding object.

collider_id: The colliding object's ID.

metadata: The intersecting shape's metadata. This metadata is different from GetMeta(String), and is set with ShapeSetData(RID, Object).

rid: The intersecting object's RID.

shape: The shape index of the colliding shape.

Additionally, the method can take an exclude array of objects or RIDs that are to be excluded from collisions, a collision_mask bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with PhysicsBodys or Areas, respectively.

Note: ConcavePolygonShape2Ds and CollisionPolygon2Ds in Segments build mode are not solid shapes. Therefore, they will not be detected.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Array IntersectPoint(
	Vector2 point,
	int maxResults = 32,
	Array exclude = null,
	uint collisionLayer = 2147483647,
	bool collideWithBodies = true,
	bool collideWithAreas = false
)

Parameters

point
Type: GodotVector2

[Missing <param name="point"/> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectPoint(Godot.Vector2,System.Int32,Godot.Collections.Array,System.UInt32,System.Boolean,System.Boolean)"]

maxResults (Optional)
Type: SystemInt32

[Missing <param name="maxResults"/> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectPoint(Godot.Vector2,System.Int32,Godot.Collections.Array,System.UInt32,System.Boolean,System.Boolean)"]

exclude (Optional)
Type: Godot.CollectionsArray
If the parameter is null, then the default value is new Godot.Collections.Array {}
collisionLayer (Optional)
Type: SystemUInt32

[Missing <param name="collisionLayer"/> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectPoint(Godot.Vector2,System.Int32,Godot.Collections.Array,System.UInt32,System.Boolean,System.Boolean)"]

collideWithBodies (Optional)
Type: SystemBoolean

[Missing <param name="collideWithBodies"/> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectPoint(Godot.Vector2,System.Int32,Godot.Collections.Array,System.UInt32,System.Boolean,System.Boolean)"]

collideWithAreas (Optional)
Type: SystemBoolean

[Missing <param name="collideWithAreas"/> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectPoint(Godot.Vector2,System.Int32,Godot.Collections.Array,System.UInt32,System.Boolean,System.Boolean)"]

Return Value

Type: Array

[Missing <returns> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectPoint(Godot.Vector2,System.Int32,Godot.Collections.Array,System.UInt32,System.Boolean,System.Boolean)"]

See Also