Forum rules - please read before posting.

Camera is not rendering

edited September 2016 in Technical Q&A
Hi everyone,
making the scene of my game I tried to put a hotspot using the tutorial on youtube, but once it was put, the camera stopped working. The message that I have is: Display 1 No cameras rendering.
image

I then removed the hotspot and all related with it (the actions and the hotspot walk to) but the problem persists...

Any idea about what is happening?

Thank you very much!!

If I click in the scene I get these errors:

NullReferenceException: Object reference not set to an instance of an object
AC.PlayerInteraction.IsMouseOverHotspot () (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:1192)
AC.PlayerMovement.UpdatePlayerMovement () (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:101)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:321)

NullReferenceException: Object reference not set to an instance of an object
AC.PlayerInput.Grab () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1730)
AC.PlayerInput.UpdateDrag () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1674)
AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:591)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:240)

But I don't have any hotspot or item to grab on it...

Comments

  • Ummm... you are not showing your other cameras in the hierarchy so it's hard to tell. There should be the main camera, plus at least one more camera which the main camera will follow. But in the scene it doesn't appear like you have anything else but the main camera. Have you tried to create a default camera from the Scene manager?
  • edited September 2016
    I tried yes, but I have to say that having only one camera, the game was working properly until I put the hotspot... I could see everything... However I'll try creating another one and making the main camera follow this one...

    Why do I need more than one camera?

    ----- I've tried creating another camera, making this one child of the main camera, using only the new camera, and it doesn't work...

    ----- Also I deleted all the cameras I had and created another one from scratch and I get the same message...

    Of course thank you for the reply! 
  • No, no, you just go into the AC editor and click the scene manager tab. There you can create cameras that will work with AC (regular cameras aren't going to cut it unless you put the components yourself, so best use the AC editor to create more). Also you'll need to define a default camera. If there isn't one already defined you can hit the create button which appears right next to the slot. There's no need to child any object. The AC main camera follows AC cameras by itself. 

    image
    image
    image
    image

    Anyways, make sure that your main camera is not disabled and that it actually has the AC Main Camera component. It may be that you main camera got disable for some reason.
  • edited September 2016
    Aha! Just to make sure, I went to my scene and deleted the main camera and I get the same error (which is sort of obvious though... all other AC cameras have their unity camera component disabled, because as I mentioned the main camera just uses them at runtime as a point of reference). 

    So either you deleted the orignal AC MainCamera, have disabled it (-there's a checkbox near the top which need to be ticked, if it's not then it's disabled), or deleted the AC MainCamera component somehow. Usually the maincamera is created for you when you organize the room objects. If you deleted the component or the original maincamera just turn a regular camera into one, scroll down in the inspector then hit Add component at the button and type Main Camera then click the component name in the list that appears. Else, as I mentioned it may be it just got disabled somehow.
  • edited September 2016
    It doesn't work.... I have the camera active, put it as a default camera and the playerStart2D has the camera too... but doesn't render...
    I have created another camera, I did the same configuration, but doesn't work...
    Here you have captures:
    The camera.
    image
    image

    The AC:

    imageimage

    Now I have a new error that says:

    NullReferenceException: Object reference not set to an instance of an object
    AC.MultiSceneChecker.Awake () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:29)

    And now I can't see the mouse or click in the menu or anything.... Is going worst...
  • edited September 2016
    Finally my camera renders, the new camera I've created didn't have checked the camera in the inspector.... Otherwise now I can't click in the scene or the player appears... It is related with the error bellow... I'll try to see if I can hunt it..

    ---- Ok if I put the script Main Camera to the camera, the message "Display 1 no cameras renedering" appears but in the MultiSceneChecker.cs the camera is not null... if I delete the component the camera renders... but in the MultiS... the camera is null... It starts to be funny! :-)

    ---- OMG! Ok, I think here is the "real" problem... When I press the start button, unity turn off all the cameras I have... I don't know why...

    image

    If I click on it then starts render...
  • I can't edit the previous message... the new question is: Why is unity disabling the cameras? Any idea to avoid that?

    THANK YOU again Alverik!
  • edited September 2016
    Hi! Anyway, as far as I know, only the camera which has the Main Camera script should have the unity camera component enabled, all others should be disabled (mind you, I mean the Unity camera script the same component you showed in your last image - the mall one, not the AC camera script, those should be enabled in all cameras). The AC Main Camera should take care of the rest. The error may have to do with the fact that the Main Camera is not there when AC tries to find it (probably because it's disabled). The other cameras are probably getting disabled by AC (it may be trying to make sure only the main camera is enabled).

    If by chance there's a problem with your main camera you may want to open a new scene, convert it to an AC scene, then take the main camera it creates for you (just prefab it), close that scene, go back to your normal scene, then drop the prefabed main camera into your hierarchy into the cameras folder (if you do this just make sure to delete the old main camera you had before).

    Ah, by the way the AC forums only lets you edit your post for an hour after posting it, after that the posts get locked.
  • edited September 2016
    Welcome to the forum, @LUXO99 - I apologise you're having some problems this early on with AC.

    First of all, be sure that you are using the very latest version of AC (v1.53d).  The console errors and screenshots you've provided suggest it's an old version of AC, so in order for us to understand them we'll need to see them when used with the latest AC.

    As @Alverik correctly states, the various GameCameras you have are being disabled by AC.  They are used purely as "reference points" for the MainCamera - which should be the only one actually rendering anything.  You can read more about the way the camera system works in Section 4.1 of the included Manual.

    The MainCamera not rendering issue has been reported before - and I'm keen to address it.  However, so far as I can tell, it does appear to be an issue with Unity 5.4 - can you let us know the exact version of Unity you're using, and on what platform?

    If the MainCamera's own Camera component is enabled when the game runs (which it should be), then Unity should render it in the Game window - if not, that to me sounds like a problem with Unity.  You should try updating to a Unity patch release.  It's also worth seeing if either of the included demo games run OK.

    Updating to the latest AC may remove your Console errors - but if they don't, please post the new error messages here (they'll be slightly different due to the line numbers) and we'll be able to help you more thoroughly.
  • Thank you again Alverik, I'll try making a new scene and getting a prefab of the camera!!

    Hi ChrislceBox!! I thought that was a good idea to remain in the same version you started the game, just in case, like you do with unreal or UDK. I'll update it and see what happens!!

    Thank you both!!
  • Hi all!

    I did both suggests and now is working!! I updated the soft and created another camera in other scene and made it prefab, and it's finally working!!

    Thank you very much!!
  • Glad to know it works. Cheers!
  • edited May 2020

    I had this problem, but now it is working... I close the game and open it again... I'm having this weird things... when I try to do the things again, from scratch it seems to work,,,

  • That's not an official AC tutorial - what issue specifically are you having, and in what AC/Unity versions?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.