Edited:
Actually I found there is a disabled component, which can make entity hidden by query. However, it works only for custom systems, neither renderer or physics care about it. I guess that’s bug right?
Origin post:
Hi, I want to implement Collection and Inventory System for my game. When I collect some items entity, I add the item an Owner component, and register the item as an element in dynamicBuffer on Owner entity. Everything works fine except the item is still in the world and can be collect again…
I thought remove anything other than required data (such as restoration value of apple) might be a way to fix the problem, but when player discard the item(to the ground), I need to instantiate different prefab in each circumstance and copy all the data to this new one. Considering there are so many items, I think that’s not good.
In short, I want an entity to be disappeared for a period of time, without run by renderer, transform and physic systems, and then simply come back to the world. Any suggestion would be appreciated.
.
BTW, I would glad to know is there any better way to implement Inventory System?
Thanks for your suggestion, that sounds good. However, it doesn’t work. I mean, after I delete the translation & LocalTW etc, the item are still rendering. I’m using prefab to instantiate item, is that the cause?
Yeah, that’s right, this idea sounds attractive and easy to do… But I was stuck by how to store different type of struct in dynamicBuffer, such as food and weapon. Any ideas about that?