var collideWithAreas: BoolIf true, collisions with Area2Ds will be reported.
var collideWithBodies: BoolIf true, collisions with PhysicsBody2Ds will be reported.
var collisionMask: UInt32The shape’s collision mask. Only objects in at least one collision layer enabled in the mask will be detected.
var enabled: BoolIf true, collisions will be reported.
var excludeParent: BoolIf true, the parent node will be excluded from collision detection.
var margin: DoubleThe collision margin for the shape. A larger margin helps detecting collisions more consistently, at the cost of precision.
var maxResults: Int32The number of intersections can be limited with this parameter, to reduce the processing time.
var shape: Shape2D?The Shape2D-derived shape to be used for collision queries.
var targetPosition: Vector2The shape’s destination point, relative to this node’s position.
func addException(node: CollisionObject2D?)Adds a collision exception so the shape does not report collisions with the specified CollisionObject2D node.
func addExceptionRid(RID)Adds a collision exception so the shape does not report collisions with the specified RID.
func clearExceptions()Removes all collision exceptions for this shape.
func forceShapecastUpdate()Updates the collision information for the shape immediately, without waiting for the next _physics_process call. Use this method, for example, when the shape or its parent has changed state.
func getClosestCollisionSafeFraction() -> DoubleThe fraction from the ShapeCast2D’s origin to its targetPosition (between 0 and 1) of how far the shape can move without triggering a collision.
func getClosestCollisionUnsafeFraction() -> DoubleThe fraction from the ShapeCast2D’s origin to its targetPosition (between 0 and 1) of how far the shape must move to trigger a collision.
func getCollider(index: Int32) -> Object?Returns the collided Object of one of the multiple collisions at index, or null if no object is intersecting the shape (i.e. isColliding returns false).
func getColliderRid(index: Int32) -> RIDReturns the RID of the collided object of one of the multiple collisions at index.
func getColliderShape(index: Int32) -> Int32Returns the shape ID of the colliding shape of one of the multiple collisions at index, or 0 if no object is intersecting the shape (i.e. isColliding returns false).
func getCollisionCount() -> Int32The number of collisions detected at the point of impact. Use this to iterate over multiple collisions as provided by getCollider(index:), getColliderShape(index:), getCollisionPoint(index:), and getCollisionNormal(index:) methods.
func getCollisionMaskValue(layerNumber: Int32) -> BoolReturns whether or not the specified layer of the collisionMask is enabled, given a layerNumber between 1 and 32.
func getCollisionNormal(index: Int32) -> Vector2Returns the normal of one of the multiple collisions at index of the intersecting object.
func getCollisionPoint(index: Int32) -> Vector2Returns the collision point of one of the multiple collisions at index where the shape intersects the colliding object.
func isColliding() -> BoolReturns whether any object is intersecting with the shape’s vector (considering the vector length).
func removeException(node: CollisionObject2D?)Removes a collision exception so the shape does report collisions with the specified CollisionObject2D node.
func removeExceptionRid(RID)Removes a collision exception so the shape does report collisions with the specified RID.
func setCollisionMaskValue(layerNumber: Int32, value: Bool)Based on value, enables or disables the specified layer in the collisionMask, given a layerNumber between 1 and 32.