Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
2
Question by MyI · Aug 09, 2016 at 06:10 AM · scripting problemprefabresolutiondisappearing

Objects disappear on resolution change

I have a strange problem where GameObjects disappear when I change the resolution in the Game tab. All but one stay on the screen. I create the objects through a script and all of them appear when the resolution is 800x600. As soon as I try another resolution though, they go away besides one of them (if I change back to 800x600 they come back); however, if I switch back to Scene view, they are clearly there.

Screenshots:

800x600 Game View: http://imgur.com/vrRdUw5

16:9 Game View: http://imgur.com/q2XITDw

16:9 Scene View: http://imgur.com/C4oLmsk

This is how I create them (Enemy_Orange3):

 public GameObject enemyPrefab;

 void Start () {
     // Spawn each enemy at a Position on screen
     foreach(Transform child in transform) 
     {
         GameObject enemy = Instantiate(enemyPrefab, child.transform.position, Quaternion.identity) as GameObject;
         enemy.transform.SetParent(child.transform, true);
         Debug.Log("Spawning enemy: " + enemyPrefab.name);
     }
 }

If you look on the left side, Enemy_Orange3 (Clone) is created and clearly there. Why do they disappear?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by MyI · Aug 09, 2016 at 06:37 AM

Never mind, it was a stupid mistake. Some of my prefabs for the enemy ship ended up having a z axis that was lower than the camera's z axis. Camera is at -10 and the prefabs were at -90 for some reason (doesn't explain why they showed up on 800x600 resolution though).

Set them all higher than the camera and they don't disappear anymore.

Comment
Add comment · Show 1 · 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 hobote · Apr 20, 2020 at 03:31 PM 0
Share

$$anonymous$$y game flickered in and out of existence at different resolutions and I found when scaling the UI window it would flicker on each frame (some difference in division meaning it just rendered out of existence) - and yep, -4008 on the z axis. Thanks!

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.

Follow this Question

Answers Answers and Comments

88 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 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 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 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 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

How to account for RNG when multiple GameObjects are using the same script? 1 Answer

How to place tree prefabs on terrain according to an arrary of distribution?,How can I place tree prefabs on terrain according to an array of coordinates? 0 Answers

Giving different values to cloned prefabs with the same script. 1 Answer

Script creating 2 prefabs instead of 1 0 Answers

Instantiate not spawning at correct position 1 Answer


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