• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Collision

    Collision encapsulates details about interactions between moving objects, including the collision's impact, the objects involved, and the exact collision points. It offers a suite of properties that provide insights into the physical dynamics of a collision, aiding in the application of game logic and physics manipulations during collision events. The Collision class is pivotal for handling "OnCollision" events, offering a detailed framework for understanding and reacting to in-game physical interactions. Refer to Unity's official Collision documentation for a deeper exploration. Unity's Collision Documentation

    Properties

    body

    ClientOnly
    ReadOnly

    Similar to 'rigidbody', it references the body involved in the collision for adjustments or analysis. Unity's Collision.body Documentation

    collider

    ClientOnly
    ReadOnly

    Points to the Collider component of the object hit, crucial for accessing collision properties. Unity's Collision.collider Documentation

    contactCount

    number
    ClientOnly
    ReadOnly

    Reveals the number of contact points in the collision, informative for collision scope assessment. Unity's Collision.contactCount Documentation

    gameObject

    ClientOnly
    ReadOnly

    Grants access to the GameObject that was part of the collision, enabling game logic application. Unity's Collision.gameObject Documentation

    impulse

    ClientOnly
    ReadOnly

    Indicates the total impulse applied to simulate the collision, useful for measuring collision impact. Unity's Collision.impulse Documentation

    relativeVelocity

    ClientOnly
    ReadOnly

    Provides the speed difference at the moment of collision, aiding in speed-based logic. Unity's Collision.relativeVelocity Documentation

    rigidbody

    ClientOnly
    ReadOnly

    References the Rigidbody of the collided object, enabling direct manipulation post-collision. Unity's Collision.rigidbody Documentation

    transform

    ClientOnly
    ReadOnly

    Accesses the Transform of the collided object, offering positional and rotational control. Unity's Collision.transform Documentation

    Methods

    Updated 4 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.