• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Component

    Inherits from:

    Component acts as the core of GameObject customization, enabling GameObjects to exhibit specific characteristics and behaviors. It's the foundation for a wide range of functionalities, from physics interactions with Collider to visual presentations via MeshRenderer and Camera components. Components transform GameObjects from static entities to dynamic actors within the game world. Scripting through LuaBehaviour further expands potential behaviors, allowing for unique game mechanics and interactions. Components are pivotal for developing immersive, interactive game environments. Explore Unity's Component documentation for detailed insights. Unity's Component Documentation

    Properties

    gameObject

    ClientAndServer
    ReadOnly

    Allows access to the GameObject this component is attached to, central to numerous Unity operations. Unity's Component.gameObject Documentation

    tag

    string
    ClientAndServer

    Accesses the GameObject's tag for identification and selection purposes within Unity's environment. Unity's Component.tag Documentation

    transform

    ClientAndServer
    ReadOnly

    Provides access to the GameObject's Transform, facilitating position, rotation, and scale adjustments. Unity's Component.transform Documentation

    Methods

    CompareTag

    ClientAndServer

    Compares the GameObject's tag with a specified string, streamlining GameObject categorization and behavior customization based on tags.

    Parameters

    tag
    string

    Tag for comparison.

    Returns

    boolean

    True if tags match, otherwise false.

    GetComponent

    ClientAndServer

    Retrieves a component of a specified type from the GameObject, crucial for accessing and manipulating attached components. Unity's Component.GetComponent Documentation

    Parameters

    type

    The type of the component to retrieve.

    Returns

    The first component of the specified type attached to the GameObject.

    GetComponentInChildren

    ClientAndServer

    Searches the GameObject's children for a component of a specific type, extending component access to child GameObjects. Unity's Component.GetComponentInChildren Documentation

    Parameters

    The type of the component to retrieve.

    includeInactive
    boolean
    optional

    Whether to include inactive GameObjects in the search.

    Returns

    The first component of the specified type attached to the GameObject's children.

    GetComponentInParent

    ClientAndServer

    Looks for a specified component type in the GameObject's parent hierarchy, useful for accessing shared components in parent objects. Unity's Component.GetComponentInParent Documentation

    Parameters

    The type of the component to retrieve.

    includeInactive
    boolean
    optional

    Whether to include inactive GameObjects in the search.

    Returns

    The component, if located in a parent.

    GetComponentIndex

    ClientAndServer

    Retrieves the index of a component, enabling more advanced management of multiple components of the same type. Unity's Component.GetComponentIndex Documentation

    Returns

    number

    The index of the component.

    Parameters

    includeInactive
    boolean
    optional

    Parameters

    includeInactive
    boolean
    optional

    Parameters

    methodName
    string

    Returns

    void

    Parameters

    methodName
    string

    Returns

    void

    Updated 27 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.