- Home /
Objects disappear on play
I have a scene with three hexagonal objects, one light, and one camera.
Everything looks as expected in Scene View and Game View while editing.
When I click the Play button, all but one of the hexagonal objects disappears in the Game View.
When I stop the play and go back to editing, everything looks normal. But hitting Play again makes the other objects disappear from the Game View.
Need some details. Are there any scripts attached to these objects? Do they have physics? Check there location during game play.
will those Objects Stay in Hierarchy view when you play or they are destroyed there?!?!? :( :O
That's really odd, it doesn't look like you have an script that could be causing the issue. Can you upload the project for me to download and play with / exa$$anonymous$$e closely?
Try disabling each one by one during your play session in the inspector. $$anonymous$$y guess is that all your hexagonal objects are just located over the top of one another.
I think you probably have something in the Start function of the script they share as prefab instances that positions them perhaps, and so they are all being positioned together.
Answer by BLarentis · Aug 23, 2012 at 02:10 PM
Try to remove the animation component of those objects.
Hehe, when you press Play, it will be consider the structure of the animation prior the changes that you made.
Thanks. Yes, removing the animation component of each object eli$$anonymous$$ates this problem. Since no animations had been created, this will work.
That is really bizarre. Ive never had that issue before. If the animation component is empty, why would it do anything to the object?
No idea, also @ravingLunatic Please don't post comments as answers.
What do you have to do when you want animation on the object? Cause $$anonymous$$e object disappears when adding an animation.
Hey, I'm having a similar problem. I have a flat terrain with two characters, one a 3rd person player and the other an npc. They both have animations, and when I press play, the npc disappears. This is strange, since I've set up this sort of thing before without issues. I restarted Unity, checked the layers, tried deactivating scripts, but nothing changes.
Thank you, @BLarentis. You solved that similar problem I have. $$anonymous$$ore power!
Answer by sskenth · Jan 12, 2017 at 09:34 PM
So I wanted to add to this because I tried the solutions above and still no luck!
Turns out that the Skinned Mesh Renderer I was using had "Update When Offscreen" unchecked! Once this was checked the animation and model stopped vanishing when it was half off screen. I hope that helps someone else in the future.
I know this is a bit late but In this case, you need to figure out why the render/occlusion bounds of the object(s) are messed up. This can be tricky because, I think due to how the hirarchy of prefabs work(?), sometimes the bounds go wonky on play even if they look right in the editor. Not entirely sure what fixes it.
Ticking that box is not a good idea long term as it causes any object with it ticked to use up draw cycles all the time and lowers the frame rate. I figured I'd add the information in case anyone else comes across it and thinks it's a good final solution.
I am using HTC Vive, and I can't seem to get this to work. Even with Update when offscreen checked, models keep vanishing. The problem I am facing is that I want the user to see their body if they look down and the body keeps vanishing.
Answer by reimeguroinferno_unity · Mar 21, 2018 at 11:47 AM
I made my own mesh in blender, but no animations are assigned and my mesh render is not a "skinned mesh renderer". Any help please?,I made my own mesh in blender but there are no animations assigned and it simply says "mesh renderer". Not skinned Mesh Render. Any help?
Answer by Haristess · May 26, 2018 at 10:56 AM
im having the same issue. ive modelled and animated my own Grass to add to my scene, and once in unity, the prefab by default gives you skinned mesh renderer and animation componants. on play it doesnt appear, but once you delete the animation componant, you can then see it during play mode.
so question too all of this, is how do i get my animation to work in unity if i cant have the animation componant? lol
The issue is because there is no animation yet. When you have the animator object on an object without any animations this will happens. Now if you have animations, you will set like an idle animation to be executed on play, and in this idle animation you will need to set the correct position of the object, this way you will be able to see the object in the correct position.
I dont understand. I animated the grass in 3dsmax using the $$anonymous$$orph modifier, and exported it via FBX into unity. After that, i select the prefab in Unity got to "Rig" and select Legacy. in the "animations" tab, i selected Loop for that particular animation.
I did infact import alot of varieties of grass that i made within 3dsmax at the time to give my game vibrancy, and about half imported fine, with no issues. the other half have this issue. i animated about 10 different varieties of grass in 3dsmax. 6 or so imported fine, the other 4 has this invisible on play issue.
I thought to begin with that my opacity or material settings were wrong, but given my grass uses the same texture maps and some were fine, and others were not. this wasnt the case. As ive said, its only when you take off the animation componant that the grass becomes visible in play mode.
$$anonymous$$y guess here is that FBX is buggy? I animated all the grass exactly the same using $$anonymous$$orph targets so i dont honestly think theres any issues with my animatiions itself.
Im clueless.
I may just try to redo the grass that didnt work again from scratch in 3dsmax and see if that rectifies the issue, but im still none the wiser as to why i would have to do this given my other grass were fine.
On those animations that are not working, have you checked the normals ? Or the initial position of the object, if it is the same as one that is working ? Those are some issues that usually happens. Also, I don't know how the legacy animations are working right now or if the FBX have been buggy ....
Answer by hawksandwichgames · May 29, 2018 at 07:00 AM
I've just had a similar problem and after messing around with some settings I managed to solve it. Maybe if you're still having trouble with it you can try the settings I mentioned in my answer: https://answers.unity.com/questions/1511845/skinned-mesh-renderer-only-appears-if-its-visible.html
Your answer
Follow this Question
Related Questions
Sprite Manager sprite is visible in Scene view but not Game view 0 Answers
What thing is making Scene view and Game view appear different? (See details) 1 Answer
Can I access VSync (Game view only) setting from code? 0 Answers
ETeeski tutorial gun script and gun placement 0 Answers
Positions of the objects in scene view and game view not the same. 1 Answer