The intended response from the code below is to load a 3d object into a scene based on buttons clicked by the user. The first time an object is selected, it is pulled from a server, stored into a cache, and added to the scene. If a user selects a different 3d object, it will remove the 3d object currently in the scene and load the new object. If the user clicks the same object again, it will remove the object from the scene.
I’m currently having a strange bug where if I first click an object and it loads, and then I select a different object, it will remove the first object, put the 2nd object into the scene (which I verify is in the scene put printing scene to the console) but it isn’t visible. Also, if I load an object, then remove it, then try to load the same object to the screen, it isn’t rendered to the screen.
In all cases, when I look at the objects in the scene, it says that the object is there and is visible. After it doesnt show up on the 2nd load, when I click different objects, they load and are removed from the scene appropriately.
Note: I’m new to asking for help like this so unsure how much code to post. And since I’m really not sure where the issue is. No errors are thrown when executing the code, and as stated, when I print the scene to console, it states the object is in the scene, you just can’t see it