I create the object.And in my object i spawn an item in fount of me.. but when i do.Code:player.gameObject.AddComponent<become>();
Its not destroying the object i spawned in. with item = GameManager.server.CreateEntity(prefab);Code:var playeritem = player.GetComponent<become>(); GameObject.Destroy(playeritem);
What am i missing
Destroying/removing an entity/object?
Discussion in 'Rust Development' started by Ts3hosting, May 12, 2018.
-
Wulf Community Admin
BaseEntity.Kill() is generally what you'd use. So with your wording, item.Kill(), though it's actually an entity, not an item.
-
is there a way to pull the item to use else where in the script to kill it.
-
Wulf Community Admin
-
can i message you this code and you can kind of see what im looking at.