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
1
Question by Zybrion · Dec 07, 2014 at 10:10 PM · cameraerrorscenescene-loading

The 3D camera no longer exists -> AudioListener Spam

Hey, I am encountering a problem.

I am in a 2D environement!

This is the scenario: If a player reaches the goal he is able to choose what he wants to do next. One option is to repeat the level. Therefore there is a button which will just load the SAME scene again.

If he retrys the level now and draws a line there is a warning:

The 3D camera no longer exists...if you have changed scenes, ensure that SetCamera3D is called in order to set it up.

Therfore I have a script which says that the camera should not be destroyed on load.

The game pretty much works again and the error above will not appear anymore BUT I then have 2 (3,4,5 depending on how many times I reloaded the level) Aadio listeners in the scene and get warnings spammed which probably affects the games performance because the more I retry the level the more laggier it gets.

If you need any further information be sure to leave a comment!

If you have a solution or suggestion it is really appreciated.

Kindly regards, René

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by screenname_taken · Dec 07, 2014 at 10:12 PM

Is your listener in the singleton object? (an object that you save and don't destroy on level reset). If yes, then you should have an if check to see if it's already alive. If it is, kill it.

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 Zybrion · Dec 07, 2014 at 10:58 PM 0
Share

Upon further investigation of the problem I realised that the real problem is that the Draw Calls double if I keep the old camera on load (obviously -.-) and therefore have get performance problems.

The reason I need the "DontDestroyOnLoad" for the camera is this error:

The 3D camera no longer exists...if you have changed scenes, ensure that SetCamera3D is called in order to set it up. UnityEngine.Debug:LogError(Object) Vectrosity.VectorLine:LogError(String) Vectrosity.VectorLine:Line3DDiscrete(Int32, Int32, $$anonymous$$atrix4x4, Boolean) Vectrosity.VectorLine:Draw() LineObject:UpdateLine() (at Assets/Draw Shapes for 2D Physic Game/Scripts/LineObject.cs:49) LineObject:Update() (at Assets/Draw Shapes for 2D Physic Game/Scripts/LineObject.cs:36)

which I do not know how to solve other than not to destroy the camera on load.

Note: I am using a drawing asset which has vectrosity included(?)

Your suggestion is good but would not solve the problem at the roots. So If you have any idea on how to solve this I would be very greatful.

avatar image
0

Answer by boazunity · Sep 03, 2016 at 01:31 PM

you need to use this line...

 void Start () {
     VectorLine.SetCamera(Camera.main);
          // or
             VectorLine.SetCamera3D(Camera.main);
        }
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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Scene loads weird 0 Answers

Scene could not be loaded even though it is in build settings 0 Answers

adding and removing objects (cameras) from other scenes than the one currently being played in 0 Answers

Camera not showing in scene view 0 Answers

Unity wants me delete something already deleted 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