Struct CollisionInfo
Keeps track of the current frames collision information.
This is used in all character controllers to help with knowing when a collision action needs to be invoked.
GroundedController2D for an example implementation.
Assembly: cs.temp.dll.dll
Syntax
public struct CollisionInfo
Fields
BelowHit
The raycast hit detected during the ground collision check for below the character controller being used.
This will return false when checked if null in an if statement when there is nothing being hit.
Declaration
public RaycastHit2D BelowHit
Field Value
Type |
Description |
RaycastHit2D |
|
CeilingHit
The raycast hit detected during the ceiling collision check for the character controller being used.
This will return false when checked if null in an if statement when there is nothing being hit.
Declaration
public RaycastHit2D CeilingHit
Field Value
Type |
Description |
RaycastHit2D |
|
CollisionHits
Declaration
public List<RaycastHit2D> CollisionHits
Field Value
Type |
Description |
List<RaycastHit2D> |
|
DistanceToGround
If this is negative that means we are in the ground and need our position corrected.
Declaration
public float DistanceToGround
Field Value
Type |
Description |
System.Single |
|
IsCollidingAbove
Keeps track if the current character controller using this collision info is colliding with anything above that matches any of it's collision mask filters.
Declaration
public bool IsCollidingAbove
Field Value
Type |
Description |
System.Boolean |
|
IsCollidingBelow
Keeps track if the current character controller using this collision info is colliding with anything below that matches any of it's collision mask filters.
Declaration
public bool IsCollidingBelow
Field Value
Type |
Description |
System.Boolean |
|
IsCollidingLeft
Keeps track if the current character controller using this collision info is colliding with anything on the left that matches any of it's collision mask filters.
Declaration
public bool IsCollidingLeft
Field Value
Type |
Description |
System.Boolean |
|
IsCollidingRight
Keeps track if the current character controller using this collision info is colliding with anything on the right that matches any of it's collision mask filters.
Declaration
public bool IsCollidingRight
Field Value
Type |
Description |
System.Boolean |
|
LeftHit
The last raycast hit detected during the side collision check on the left side for the character controller being used.
This will return false when checked if null in an if statement when there is nothing being hit.
Declaration
public RaycastHit2D LeftHit
Field Value
Type |
Description |
RaycastHit2D |
|
OnCollidedAbove
Declaration
public Action OnCollidedAbove
Field Value
OnCollidedBelow
Declaration
public Action OnCollidedBelow
Field Value
OnCollidedLeft
Declaration
public Action OnCollidedLeft
Field Value
OnCollidedRight
Declaration
public Action OnCollidedRight
Field Value
RightHit
The raycast hit detected during the side collision check on the right side for the character controller being used.
This will return false when checked if null in an if statement when there is nothing being hit.
Declaration
public RaycastHit2D RightHit
Field Value
Type |
Description |
RaycastHit2D |
|
WasClimbing
Declaration
Field Value
Type |
Description |
System.Boolean |
|
WasCollidingAbove
Declaration
public bool WasCollidingAbove
Field Value
Type |
Description |
System.Boolean |
|
WasCollidingBelow
Declaration
public bool WasCollidingBelow
Field Value
Type |
Description |
System.Boolean |
|
WasCollidingLeft
Declaration
public bool WasCollidingLeft
Field Value
Type |
Description |
System.Boolean |
|
WasCollidingRight
Declaration
public bool WasCollidingRight
Field Value
Type |
Description |
System.Boolean |
|
Properties
ClimbableSurface
Declaration
public ClimbableSurface ClimbableSurface { get; set; }
Property Value
ClimbableSurfaceHit
Declaration
public RaycastHit2D ClimbableSurfaceHit { get; set; }
Property Value
Type |
Description |
RaycastHit2D |
|