docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GameObjectExtensions

    Extension methods for GameObject related to netcode worlds.

    Inheritance
    object
    GameObjectExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Netcode
    Assembly: Unity.NetCode.dll
    Syntax
    public static class GameObjectExtensions

    Methods

    NetcodeWorld(GameObject)

    Gets the NetcodeWorld associated with this gameObject. Can be useful to check whether a given GameObject is associated with a client/server world without having a GhostBehaviour or a GhostObject

    Declaration
    public static NetcodeWorld NetcodeWorld(this GameObject self)
    Parameters
    Type Name Description
    GameObject self

    The GameObject to look up the world for.

    Returns
    Type Description
    NetcodeWorld

    The NetcodeWorld(GameObject) associated with this GameObject

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)