Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by gintechsystems · Feb 25, 2015 at 02:46 PM · androiddeviceonbecameinvisible

OnBecameInvisible Not Working Real Device

Hello,

I have implemented OnBecameInvisible() and attached the script to my game object. I have added a renderer and got it working, but only when I use the unity editor? The function is never called when I am using a real device such as my android phone. Why is this? Do I need to adjust other settings, such as the camera?

Comment
Add comment · Show 10
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 Landern · Feb 25, 2015 at 01:59 PM 0
Share

This might sound silly, but is there a renderer on the GameObject that your observing that also has the script on it?

avatar image hexagonius · Feb 25, 2015 at 03:06 PM 1
Share

How is it disappearing? It only works when it was visible at some point. In the editor this might work because the object is seen by the editor cam and after play not seen anymore because of maximizeonplay for example.

avatar image gintechsystems · Feb 25, 2015 at 06:59 PM 0
Share

Yes there is a renderer. I have never used maxonplay for this game, but i have the scene biew over the camera. I have objects that fall from the top of the screen. When they are first created, id say they are half on the screen / half off to show as if they are inco$$anonymous$$g. Is that really an issue? I do have origin prefabs outside of my canvas that are cloned and put in the camera view. They are seen and i can even interact with them with my raycasts.

avatar image gintechsystems · Feb 25, 2015 at 08:31 PM 0
Share

I can put up some screenshots if needed, let me know.

avatar image gintechsystems · Feb 25, 2015 at 09:32 PM 0
Share

When I turn on maximize on play, you are right the function is never called. I do use a canvas & only have the main camera.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by gintechsystems · Feb 27, 2015 at 01:34 AM

This may not be the answer for everyone but I have figured out my issue. I changed my canvas render mode to screen space - camera. Apparently that function never gets called when using screen space - overlay, at least to my knowledge I could not figure out how to get it to work. I did also have to resize the camera to the size of the view so that way the camera did see the objects and when they left. I assumed when screen space - overlay was used, the camera would automatically see anything that comes in and leaves. This does not seem to be the case?

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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

deviceUniqueIdentifier 1 Answer

How to detect if the device is android mobile or tablet 2 Answers

Error to run on the Android emulator! 0 Answers

How do I set up an Android device for Build & Run? 9 Answers

Turn your Android device webcam (Camera) , flash light 3 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