Hey, how can i get the short name of "go" at OnEntityBuilt?
I try:
but i get only this error messageCode:if (go.ShortPrefabName == "cupboard.tool.deployed.prefab") { Puts("Cupboard placed"); }
thanks for helpCode: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?![]()
Solved Getting ShortPrefabName in OnEntityBuilt?
Discussion in 'Rust Development' started by Terrance, Apr 10, 2018.
-
Code:
BaseEntity entity = go.GetComponent<BaseEntity>(); BasePlayer player = planner.GetOwnerPlayer(); if (entity.ShortPrefabName == "cupboard.tool.deployed") { Puts("Cupboard placed"); }
Code:if (go.GetComponentInParent<BuildingPrivlidge>() != null) { Puts("Cupboard placed"); }
Last edited by a moderator: Apr 10, 2018 -
thanks, it works