I have a BP only project. All my plugins are installed in 4.16/Engine/Plugins/Marketplace/…/
I try to reparent one plugin GameInstance with another plugin GameInstance. I try both ways (vice and versa). I always get the Data Loss error. When I reparent, one just turns into the other.
You cannot have two parents in inheritance. For that you may want to to an inhertance chain. GameInstance1 → GameInstance2 → YourGameInstance. It is not a very good solution but you will be able to have all the functionalities from the parents in your child.
You can decide which one will be the parent and do a simple reparent from one to the other, or just merge behaviour on a single file. You will only want to use inheritance when you will have different Game instances for different situations.
I’m sorry but I just don’t get what you’re saying.
Make three GameInstances, one is UGameInstance.
Reparent UGameInstance to a GameInstance…then reparent the final GameInstance to the UGameInstance which had its parent changed? It just doesn’t work.
Reparent one GameInstance to another GameInstance does not leave me with all the functionalities from BOTH GameInstances.
Might I need to merge both to one single file? <— How do I do it?
No, UGameInstance is the Unreal Engine base GameInstance, you shouldnt reparent that at all. You may need to have an structure like this one in terms of inheritance UGameInstance as the base parent, then one child and another one inheritating from that child.
So how do I do it? x)
My project is BP only. You’re saying convert to C++? Edit a GameInstance C++ class to change it from UGameInstance to another GameInstance class?
To merge both in the same file you may want to reprogram the behaviour you have in one in the other one. And yes, inheritance will give you what you need, take a look at the concept of inheritance in OOP.
No, im not saying that, im speaking in a BP’s background. Im saying to take one of your GameInstances and reparent to the other one which is child of UGameInstance.
If both game instances that you have inheritate already from UGameInstance you dont need to create anything, just reparent one to the other. Have in mind that if you have duplicated functions they may conflict
They are both UGameInstance types. Not Platform. But reparenting doesn’t allow the first one to be used. In vice or versa. None of functions are the same.
What do you mean inherited from UGameInstance?
Both appear when I search “GameInstance” but I know in 4.16/Engine/Plugins they both have “Source” folders and .cpp and .h files.
Inheritance is the same in all contexts when you are working with OOP. I sent you the video to understand inheritance, not to copy and paste what he is doing. Enter Unreal Slakers and ask in #programming, we will be able to help you better there. Its a chat, just google it.