1. Hey, how can i get the short name of "go" at OnEntityBuilt?

    I try:

    Code:
    if (go.ShortPrefabName == "cupboard.tool.deployed.prefab") {
       Puts("Cupboard placed");
    }
    
    but i get only this error message

    Code:
    error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `ShortPrefabName' and no extension method `ShortPrefabName' of type `UnityEngine.GameObject' could be found. Are you missing an assembly reference?
    thanks for help :)
     
  2. Code:
    BaseEntity entity = go.GetComponent<BaseEntity>();
    BasePlayer player = planner.GetOwnerPlayer();
    if (entity.ShortPrefabName == "cupboard.tool.deployed")
    {
       Puts("Cupboard placed");
    }
    
    [DOUBLEPOST=1523368429][/DOUBLEPOST]or
    Code:
    if (go.GetComponentInParent<BuildingPrivlidge>() != null)
    {
       Puts("Cupboard placed");
    }
     
    Last edited by a moderator: Apr 10, 2018
  3. thanks, it works :)