SF Tool Documentation
Search Results for

    Show / Hide Table of Contents

    Class CollisionInfoBase

    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. for an example implementation.

    Inheritance
    System.Object
    CollisionInfoBase
    BodyCollisionInfo
    Namespace: SF.PhysicsLowLevel
    Assembly: cs.temp.dll.dll
    Syntax
    public abstract class CollisionInfoBase
    Remarks

    Depending on if you are using the low or high level physics you will either use and , or you will use and These are collisions from Collision based callbacks that interact with a non-trigger collider. Used for platforms, walls, and physical objects that can stop the player.

    Fields

    CollisionActivated

    Declaration
    public bool CollisionActivated
    Field Value
    Type Description
    System.Boolean

    CollisionContactThreshold

    The threshold for the normals of a contact to pass to be considered an actual collision.

    Declaration
    public float CollisionContactThreshold
    Field Value
    Type Description
    System.Single
    Examples

    Useful for removing ghost collisions and also collisions on physics shapes with rounded corners like capsules and circles.

    ControlledGameObject

    Declaration
    public GameObject ControlledGameObject
    Field Value
    Type Description
    GameObject

    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 there is anything below that can make a contact point callback on collision.

    Declaration
    public bool IsCollidingBelow
    Field Value
    Type Description
    System.Boolean
    Remarks

    This is more than just platforms. It can be anything like projectiles, magic, gust of wind, enemies head for bouncing. IsGrounded is specifically for platforms.

    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

    IsGrounded

    Keeps track if the current character controller using this collision info is colliding with anything below that matches any of it platform collision filters.

    Declaration
    public bool IsGrounded
    Field Value
    Type Description
    System.Boolean

    OnCeilingCollidedHandler

    Declaration
    public Action OnCeilingCollidedHandler
    Field Value
    Type Description
    Action

    OnCollidedLeftHandler

    Declaration
    public Action OnCollidedLeftHandler
    Field Value
    Type Description
    Action

    OnCollidedRightHandler

    Declaration
    public Action OnCollidedRightHandler
    Field Value
    Type Description
    Action

    OnGroundedHandler

    Declaration
    public Action OnGroundedHandler
    Field Value
    Type Description
    Action

    StandingOnObject

    Declaration
    public GameObject StandingOnObject
    Field Value
    Type Description
    GameObject

    WasClimbing

    Declaration
    public bool WasClimbing
    Field Value
    Type Description
    System.Boolean

    WasCollidingAbove

    Declaration
    public bool WasCollidingAbove
    Field Value
    Type Description
    System.Boolean

    WasCollidingBelow

    Was the ControlledGameObject colliding with anything below.

    Declaration
    public bool WasCollidingBelow
    Field Value
    Type Description
    System.Boolean
    Remarks

    This is not the same as grounded. Grounded is touching a platform below while this can be anything. Enemies head to bounce off of, spell, projectile, and so forth.

    WasCollidingLeft

    Declaration
    public bool WasCollidingLeft
    Field Value
    Type Description
    System.Boolean

    WasCollidingRight

    Declaration
    public bool WasCollidingRight
    Field Value
    Type Description
    System.Boolean

    WasGroundedLastFrame

    Was the ControlledGameObject on the ground last frame.

    Declaration
    public bool WasGroundedLastFrame
    Field Value
    Type Description
    System.Boolean
    Remarks

    Note even flying objects can be grounded. Imagine an enemy that that is knocked down or stunned and it hits the ground.

    Properties

    ClimbableSurface

    Declaration
    public ClimbableSurface ClimbableSurface { get; set; }
    Property Value
    Type Description
    ClimbableSurface

    Methods

    CeilingChecks()

    Declaration
    public virtual void CeilingChecks()

    CheckCollisions()

    Declaration
    public virtual void CheckCollisions()

    CheckOnCollisionActions()

    Checks to see what sides might have a new collision that was started the current frame. If a new collision is detected on the side invoke the action related to that sides collisions.

    Declaration
    protected virtual void CheckOnCollisionActions()

    GroundCollisionChecks()

    Declaration
    public virtual void GroundCollisionChecks()

    Initialize()

    Declaration
    public virtual void Initialize()

    SideCollisionChecks()

    Declaration
    public virtual void SideCollisionChecks()
    In This Article
    Back to top Generated by DocFX