playMaker

Author Topic: Help Scene Load.  (Read 1929 times)

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Help Scene Load.
« on: October 23, 2015, 12:15:05 PM »
I have 3 scene. The first scene is the menu, I press start buttom, then when unity load scene 2, the ImageTarget is disable.

I put to the ARcamera in scene 2 with Keep Alive Behaviour On, because i need the same camera in scene 3.

But if i turn Off Keep Alive Behaviour, when load the level 3, it give me another error,

(MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.

Your script should either check if it is null or you should not destroy the object._
 
 
I dont now how to fix this. Help please.

Nog

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Help Scene Load.
« Reply #1 on: October 23, 2015, 02:41:37 PM »
Hello nabilfx,

It sounds like your camera that your action is referencing is destroyed, so it no longer exists in the next scene. You need Playmaker to find the camera you want to keep. You may even have an identical camera in scene 3 that is confusing the action that is trying to reference it.

One way to do this is to use the action Don't Destroy On Load. It will keep the camera around in every scene. If you have an identical camera in each scene, you may need to create a system that tags the objects that you want to keep through out each scene with a specific tag, and then illuminates any duplicates with a different tag. It would be great to have a single action that could do all of this in one go around.

Also, when your scene loads, you could use the Find Game Object action to find the camera, and then load it into an object variable. You could then use the Set FSM Object action to load it up into the correct action that references it.

I hope that I have not confused you more than helped.

Nog

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: Help Scene Load.
« Reply #2 on: October 23, 2015, 02:56:56 PM »
the problem is this (Keep Alive Behaviour)
 the image target that are in the loaded scene are disabled.

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: Help Scene Load.
« Reply #3 on: October 23, 2015, 03:19:33 PM »
this everything working right, I have three scenes, what i need is in a group with dont destroy on load.

Vuforia camera is with this KeepAliveBehaviour check, because i need to go with her through the other scenes.

The problem is that in the first scene I have the login, then jumps to the game scene, but the image target, is disable and not work.

But if i start right on the game scene, there is no error.

I do not know what to do to fix

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: Help Scene Load.
« Reply #4 on: October 23, 2015, 03:22:48 PM »
Nad if i dont check KeepAliveBehaviour, runs ok, but when the playmaker event jump to the another scene,this error appears.

MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.