Replacing a model in the right place


Let’s say I imported a FBX with a table and an apple (one FBX with each object’s pivot placed at the world origin but not each object’s center). The apple is somewhere on the table but not in the center. Here, what if I want to replace the apple in place with a banana (another FBX) whose pivot is the world origin and also the banana’s center.

I am not allowed to have the banana’s position be the same as the apple in FBX itself.
I loaded those two FBXs and hid the banana at the beginning and then wanted to hide the apple and show the banana in the right place. How can I do this in code?

Thank you,

I assume you don’t have the source files for the models to re export correctly so that the origin is the same in both?

A work around is to have the entity that has the model be a child of another entity (parent) and that way you can position the model entity to visual be where the parent entity is.

You can do this in code but it is really fiddly and it’s just less complex to do the above.