You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was fixing the Component framework of your Engine and I trembled with a strange error. All the commented code is in the COMPONENTS branch of our engine as I don't want to merge it yet until it works perfectly fine.
The thing is that Components are created in the ModelLoader::loadfromFile() method that returns a GameObject with its necessary components but once I try to add this GameObject as a child of scene->root (using emplaceChild) I find that the Components of the added GameObject have lost their owner pointer (that points to the GameObject created with them). The pointer is not NULL but is instead an strange name that I suspect is binary or something similar.
The Error happens when I call the method owner()->GetComponent() and does not find the Component because the owner() returns something strange. The catch here is that the owner()->GetComponent() that ends the code is one in the Mesh::drawModel() function but (strangely) is not the first I call.
I think that the problem lies in that in some point the code is not correctly moving the pointers but I am unable to find where or why.
Thank you,
Pol Celaya
The text was updated successfully, but these errors were encountered:
Hi @pcelaya !
A part of moving the components you have to reasign the owner of the components.
If you can not do that, due to the owner being a reference, try with a pointer instead.
Hello @pepcots,
I was fixing the Component framework of your Engine and I trembled with a strange error. All the commented code is in the COMPONENTS branch of our engine as I don't want to merge it yet until it works perfectly fine.
The thing is that Components are created in the ModelLoader::loadfromFile() method that returns a GameObject with its necessary components but once I try to add this GameObject as a child of scene->root (using emplaceChild) I find that the Components of the added GameObject have lost their owner pointer (that points to the GameObject created with them). The pointer is not NULL but is instead an strange name that I suspect is binary or something similar.
The Error happens when I call the method owner()->GetComponent() and does not find the Component because the owner() returns something strange. The catch here is that the owner()->GetComponent() that ends the code is one in the Mesh::drawModel() function but (strangely) is not the first I call.
I think that the problem lies in that in some point the code is not correctly moving the pointers but I am unable to find where or why.
Thank you,
Pol Celaya
The text was updated successfully, but these errors were encountered: