I have a Actor class called Inventory
My question is, what is more convenient?, Instantiate this inventory invisibly on my level or instantiate within my character class?
Some consideration?
Thank you!
I have a Actor class called Inventory
My question is, what is more convenient?, Instantiate this inventory invisibly on my level or instantiate within my character class?
Some consideration?
Thank you!
Is there any need to have your inventory existing in the level? If not, you should have your Inventory
class extend Object
and then simply instantiate it in your Character
class.
It’s better to do inventory (manager i assume :p) from AActor, you might some problems with () and other world interactions from UObject, same as AGameMode is a actor… in fact that where inventory systems was since first Unreal:
Also if you make something simpler you can just do simple TArray with items in character
It’s better to instantiate inventory in the class so you can refrence it easier, if you doing single player and you want to have global inventory place it in AGameMode or AGameState, if you want inventory assigned more to player then his character PlayerController is probably better place as character might be destroyed and lose inventory (or else you do some pointer juggling)
That is a really good point . Such a good point that I’ll be moving my relatively large existing inventory system to extend AActor
instead of Object
.
Thank you very much for your answers, was very clear