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
4
Question by omriysh · Sep 02, 2014 at 11:13 PM · error

"screen position out of view frustum" Error

Hello,

First of all I would like to apologise if I make any English mistakes, English is not my first language....

Anyway, I am working on a game called "Garfio", a 2d game that uses primarily mouse controlls. Yesterday I started having the "screen position out of view frustum" error when I run my scenes (Yes, I tried to create more scenes and it infected them as well). I tried any solution in the book (restarting unity, restarting my computer, creating new scenes, starting the game with my mouse off the screen, messing around with some camera settings, even building and running - where the game simply crashed) but nothing worked. I don't know what to do, and I can't create my game like this (oviously), and I need help. I did use the latest beta of Unity 4.6 .

Can anyone help me find a solution?

Thank you for your time.

Comment
Add comment · Show 7
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 omriysh · Sep 03, 2014 at 03:16 PM 0
Share

Thats a bit of a problem... I am currently checking the game objects one by one, trying to see which is creating the problem, also trying to not use prefabs in case one of them includes the error. When I find the object the causes the problem I will publish all the code related to this object. As it is, there is way to much code to show. This is (was) a working peototype of a game.

avatar image _dns_ · Sep 03, 2014 at 04:34 PM 0
Share

Hi, is this message an exception from your code or from the Editor itself ? If it is from your code, you should be able to catch it by debugging the project using $$anonymous$$onodevelop for example. I guess there are tutorials/videos on how to do it.

avatar image IvovdMarel · Sep 03, 2014 at 04:45 PM 0
Share

http://forum.unity3d.com/threads/solved-screen-position-out-of-view-frustum.60851/

Is one of your cameras near clip planes set to 0?

avatar image omriysh · Sep 03, 2014 at 06:07 PM 0
Share

dns: Can you please give me a few more details? I don't understand what you mean...

Ivovd$$anonymous$$arel: I did check this. As said above, I scanned the internet for hours to find a solution, since I put a lot of time into the project.

avatar image _dns_ · Sep 03, 2014 at 09:26 PM 0
Share

I didn't watched those videos but searching "unity how to debug monodevelop" on youtube gave me those links: https://www.youtube.com/watch?v=-D6qXaGSC2k or https://www.youtube.com/watch?v=vhT$$anonymous$$5weADhU When debugging, use the menu "run/exceptions" to add all Unity/Editor exceptions. If you don't know debugging at all: you'll see a lot of possibilities to make your dev easier, I'm sure you'll think of lots of past difficulties that could have been easier with a debugger ! :-) Trust me, you need to master that !

Show more comments

6 Replies

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

Answer by omriysh · Sep 08, 2014 at 03:05 PM

I just did some testing, changed the camera to a different one and placed the smae scripts on it, and it works perfectly. I don't know what the problem is, so I am leaving this question open, for anyone who knows a solution, and for anyone who has the smae problem in the future. Thanks to everyone who helped!

Comment
Add comment · Show 3 · 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 omriysh · Sep 08, 2014 at 02:28 PM 0
Share

Found the problem! This took so much work, but I finally fount the source.

The problem was, eventually, a script problem. I had a zoo$$anonymous$$g script for the camera, that sets its orthographic size. It worked perfectly when I created it, but I dont know what happened and it was causing the problem. This is the script:

using UnityEngine; using System.Collections;

public class Zoo$$anonymous$$g : $$anonymous$$onoBehaviour { public float zoom;

 void Start ()
 {
     zoom = PlayerPrefs.GetFloat("Zoom");
     camera.camera.orthographicSize = zoom;
 }
 
 void Update () 
 {
     if(Input.GetAxis("$$anonymous$$ouse ScrollWheel") > 0)
     {
         camera.camera.orthographicSize-=.25f;
         zoom = camera.camera.orthographicSize;
         PlayerPrefs.SetFloat ("Zoom", zoom);
     }
     else if(Input.GetAxis("$$anonymous$$ouse ScrollWheel") < 0)
     {
         camera.camera.orthographicSize+=.25f;
         zoom = camera.camera.orthographicSize;
         PlayerPrefs.SetFloat ("Zoom", zoom);
     }
 }

}

Priviously, the "Start" function was "Awake". i Don't know why, but it was causing the problem.

avatar image Bonfire-Boy omriysh · Nov 28, 2015 at 02:00 PM 0
Share

I would guess that the times it worked and didn't will be to do with what was saved to PlayerPrefs.

I think it's good to get into the habit of checking the value returned by GetFloat() etc before using it. A simple check on zoom before you use it to set the camera size would have caught this immediately.

You can also pass in something that doesn't break it as a default parameter (a second parameter to GetFloat() is a default value) but that runs a bit more risk as it can hide problems rather than reveal them.

avatar image IvovdMarel · Sep 08, 2014 at 05:01 PM 0
Share

Be careful with this 'fix'. I am assu$$anonymous$$g it got messed up because zoom was 0, which set your orthographicSize to 0, which might be the reason for that error.

Also, I see you call PlayerPrefs.SetFloat, but do you also call PlayerPrefs.Save() ?

avatar image
12

Answer by RandomCharacters · Oct 02, 2015 at 12:15 AM

Right click on the Scene tab and close it, then right click on any other tab and open the scene tab again.

Comment
Add comment · Show 3 · 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 MooJac · Jun 15, 2017 at 11:48 PM 0
Share

This worked perfectly for me. Thanks!!

avatar image imdadahmadmian · Jan 18, 2018 at 08:35 AM 0
Share

this worked for me ..Thanks

avatar image carcanhadesapo11 imdadahmadmian · Jan 29, 2019 at 01:33 PM 0
Share

I did not understand, can you explain a little more?

avatar image
-1

Answer by carlilelance_unity · Mar 26, 2019 at 09:48 PM

This occurred in my scene when I added a the Water4 prefab from Unity's Standard Assets while using a camera with Projection set to Orthographic.

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
avatar image
0

Answer by P3JX · Nov 28, 2015 at 09:35 AM

This Error Occur to me because i use Gizmos.DrawWireCube() Inside OnDrawGizmos() to draw an outline in screen view that shows camera boundaries.

it works on older version of unity but I upgraded and now it gives me an error (but still works).

once the error occurs at the startup I can just can clear it out and work.

Its annoying. I just delete my code and error goes away.

May be error with your code. I just try previous answer and not works for my case.

( Don't have time to in-depth look at the code but it also use cameraOthograpicSize )

 float verticalHeightSeen = Camera.main.orthographicSize * 2f;    
 Gizmos.color = Color.cyan;
 Gizmos.DrawWireCube(transform.position, 
     new Vector3((verticalHeightSeen * Camera.main.aspect ), verticalHeightSeen, 0));

Hope this help to someone

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
avatar image
0

Answer by vlab22 · Jan 25, 2019 at 06:23 AM

Happens to me because I've done erratic camera movement. In my situation, my camera was a child of a gameobject with a rigidbody with 0 mass, not only zero but that "infinity ZERO".

After add a impulse to this rigidbody, it goes "to infinity and beyond" and this bugs camera's ScreenPointToRay methods.

So a attempt solution is to analyse the camera movement.


Unity 2018.2.12f1 | Windows 10

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
  • 1
  • 2
  • ›

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

13 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

Related Questions

I am having two errors with my jump script 1 Answer

Unity fails to recognize Maya models/Unity scenes 1 Answer

NullReferenceException: Object reference not set to an instance of an object NetworkManager.SpawnMyPlayer () (at Assets/NetworkManager.cs:46) 1 Answer

Error in script 1 Answer

Playing with the Gravity PROBLEM 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