- Home /
Problem is not reproducible or outdated
Instantiated models aren't visible.
I have a problem here, I am creating new project, everything goes fine. Added online mode, player spawns... but when I press right click weapon should instantiate and it does! But it's not visible :( any part of it isn't visible at all. When I pause the gameplay, go to weapon in inspector, disable and re enable the part of model or mesh renderer of that part, that part shows up! Doing the same with other parts is also OK. I tried to make the script with similar functionality like doing everything in editor, but that didn't work. Can someone help me? Here's the link to the model that I used: http://tf3dm.com/3d-model/aek-4273.html Is that model problem or what? Because other model instantiated fine. Also if I put weapon inside character's prefab deep inside characters model(hand of character) character spawns but weapon doesn't. Also tried both Network.Instantiate and regular Instantiate
Is it instantiating to a Layer not rendered by the camera?
No, the layer is visible for the camera, the instantiated object is not even visible in the editor unless I disable and re enable mesh renderer of every part of gun.
Ok, I got me out of this, the most unexpected thing that could happen: I was looking what to optimise in the game because it was with $$anonymous$$esweeper optimisations and found a code from one youtube guy to generate cubemap reflections on any material, after disabling it, performance was increased a lot, but when noticed that gun is being drawn fine, but the last thing is this: why this script could affect rendering on those instantiated objects? here's the code: http://pastebin.com/qkcnWFjW
Answer by screenname_taken · Jul 04, 2014 at 06:02 PM
I can't think of why this would happen, but if you can't find a real fix, perhaps disable and re-enable the mesh renderer via script. On the same script that instantiates the gun.
Follow this Question
Related Questions
Why is my instantiated prefab invisible ? 2 Answers
GUIText is invisible after instantiate 1 Answer
Ferr2D Terrain Problem when i instantiate from resources 0 Answers
Player invisible on respawn 2 Answers
Checking if object intersects? 1 Answer