• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Tomza · Sep 07, 2013 at 08:10 AM · animationmeshcharactermecanim

Why is my animated with Mecanim character (enemy) not visible in game (play) mode?

Hi! I'm an experienced game developer and all problems I can solve, but I can't understand why my animated (with Mecanim) characters (enemies) sometimes aren't visible in game(play) mode. I can do nothing to fix that. When I restart Unity 4.2, they are visible again. It's the only way I know to solve this irritating problem. Everything is OK in Scene (Edition) mode, but when I hit "Play" they simply disappear. Not always, but often. They exist in the Hierarchy and in the Scene. There's voice, even Halo I added; they even can be shot down (I see the red cross-hair and the Halo); there's all but not visible mesh. There aren't such problems with other game objects. Is it a bug in Unity? Please tell me if you have the same problems. Or maybe somebody from the Unity team explain me this strange behavior.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benproductions1 · Sep 07, 2013 at 12:29 PM 0
Share

you do know you have to run the animation? The preview does not equal what will actually happen

avatar image Tomza · Sep 07, 2013 at 12:54 PM 0
Share

The animation is running. Sometimes characters don't simply appear in Play mode. The conditions for the game are always the same. I am forced to restart Unity to fix it. Though the characters aren't visible, the animation is running because the enemies walking and attacking my Player all the time. They make sound and all seems O$$anonymous$$, but they are invisible. They can be shot down. I'm new here and I'm not a native speaker in English so tell me what "The preview does not equal what will actually happen" means.

avatar image Benproductions1 · Sep 08, 2013 at 01:56 AM 0
Share

Can you give a more concrete example as to when exactly this happens and what exactly happens. There are so many things that could cause something not getting rendered. (SOO $$anonymous$$ANY)

By the Preview not equalling what will actually happen, I mean that when you for instance preview an animation in the scene view using the animation editor, that has absolutely nothing to do with the rest of the game (other than the animation).

avatar image Tomza · Sep 08, 2013 at 08:47 PM 0
Share

It's just the problem that I don't know when and what. Sometimes my enemies simply aren't visible though they exist in the Hierarchy and Scene. I can fix that by restarting Unity so I think it's because of the Unity. It's hard to say something more. Really it's strange. It didn't happen earlier. I have done many things since that moment. When it happen to me again, I'll try to show you a screen shot. Everything is O$$anonymous$$ in the Scene view. I just hit play (fullscreen) and my enemies aren't visible. I tried smaller sizes of the window -- always the same. So far, I don't see any logic in that. All my problems with game developing I was able to solve by myself, and I have never asked somebody to help. But this situation astonished me. I don't see any solution but restart Unity. Today, this problem didn't happen. We'll see what will be tomorrow. I am not sure it is a problem connected with renderer. Ah, earlier I saw some enemies being visible and the others being invisible at the same time. And I should add that all my enemies are instantiated at the beginning of my game from the same prefab of character. I use only one prefab for my enemies.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by fherbst · Sep 09, 2013 at 01:11 AM

Might it be that you have some custom shader going on or custom mesh generation? Unity culls objects early depending on their bounds. That means that if some object's bounds are wrong (e.g. they aren't "bounding" the visual representation of the object), objects might get culled although they should be visible.

Comment
Add comment · Show 22 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tomza · Sep 09, 2013 at 07:21 AM 0
Share

Here is the screenshot. I did it after exporting the game. All my enemies are invisible in this game. You see the red crosshair and the slight Halo around the enemy that is going towards me. alt text

invisibleenemies.png (403.5 kB)
avatar image Tomza · Sep 09, 2013 at 07:31 AM 0
Share

Shader? But why the enemies are invisible only sometimes? And even only a part of enemies are invisible. Remember that all my enemies are from one prefab. They are the copies of one character. If shader or renderer were a problem, that strange situation happened all the time or for all my enemies.

avatar image Benproductions1 · Sep 09, 2013 at 07:42 AM 0
Share

@$$anonymous$$za could you be a bit more specific (even post code) with what you are doing. There are so many ways things can "become invisible". Is the mesh renderer perhaps inactive?

avatar image Tomza · Sep 09, 2013 at 06:10 PM 0
Share

I thought I gave a lot of details, but O$$anonymous$$! I'll try to be more specific. This situation is hard for me and I knew it would be so for you too. I'm not surprised that it will be hard to find any solution (except for restarting Unity of course). Every time I start Unity, the conditions of my game are the same. And sometimes my enemies aren't visible. I do nothing what can cause such a strange behavior. It's independent of whatever I'm doing. It's not a big problem for me -- I just restart Unity and everything is O$$anonymous$$. But I'm just curious. I'm trying to understand this situation. I think it isn't my fault (my code or something). It's a problem co$$anonymous$$g from Unity. Enemies are instantiated at the beginning of the game with a script. It's a normal script -- nothing strange in it. Really! Believe me. But even not instantiated characters (I did that for testing purposes) behave in this way. Strange! So it's not a problem connected with the instantiating script. The character prefab has animation (walking and dying)run in $$anonymous$$ecanim. It's driven by script -- nothing strange too. I don't think the scripts are problem. They are tested very well.

Now I have some idea -- maybe my laptop is too weak to run the game, and it just not rendering the enemies or all enemies (30 enemies instantiated at the beginning of my game; they all animated and many other things). 2 GB RA$$anonymous$$, XP, Procesor x86 Family 6 $$anonymous$$odel 15 Stepping 13 GenuineIntel ~1795 $$anonymous$$hz, Core 2, 384 $$anonymous$$B $$anonymous$$emory of Video Adapter. It can be a problem because sometimes Unity has problems with running my game. When I export, it's much better. I lightmapped but my game still need much resources. I have a lot of grass, etc.

What do you think? Thanks in advance for your opinions.

avatar image Benproductions1 · Sep 10, 2013 at 07:30 AM 0
Share

Do you have occlusion culling enabled? Can you see the enemies if you go back to scene view (does it only happen in the game view)?

If your laptop were too weak to run it, then either Unity would crash (out of memory) or you would get terrible framerate. Unity doesn't occlude objects randomly to save memory

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Characters Interaction with Mecanim Animations 2 Answers

First Person Legs. 3 Answers

Can you add animations from one rigged character to another using Mecanim? 2 Answers

Setting up a character for mecanim? 1 Answer

Steps to make an animated character from scratch 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges