Home › Forums › Software Development › Application.LoadLevel doesn't load Tobii in the EXE
- This topic has 5 replies, 3 voices, and was last updated 8 years, 9 months ago by Daniel.
- AuthorPosts
- 01/05/2015 at 14:32 #2925Bianca ZanklParticipant
Hi there!
My game uses Tobii EyeX in Unity 5. The EyePositionDataComponent Script is attached to a first person Player. Each level has its own player. I have a level with several boxes. They are either visible or invisible depending on whether the user opens the left or right eye. Everything works great when I play this scene in the editor. I can also build an application of this single level and everything works as expected. The problem occurs when I try to access the level with Application.LoadLevel <b>in the application</b>. It doesn’t happen in the editor.
I thought it’s because I get a new Player for each scene, but adding the script to an empty game object in the first scene and setting it to “DontDestroyOnLoad” didn’t help. I can’t understand why this problem occurs <b>only</b> in the application. Any ideas?
Thanks in advance
28/05/2015 at 14:16 #3011Bianca ZanklParticipantAny ideas?
28/05/2015 at 14:37 #3012Patrik [Tobii]ParticipantHello Bianca,
Sorry for the late reply!
I will take a look at your issue and see if I can see what’s going on.Best regards
Patrik15/06/2015 at 14:46 #3133Bianca ZanklParticipantThank you very much, please let me know if you find something.
I still have no idea how to solve the problem.17/02/2016 at 07:11 #4453DanielParticipantI am also having issues with this. The EyeXHost is created in one scene and is itself set to be persistent with Don’t DestroyOnLoad, but when I load a new scene, I lose tracking capability. I also went as far as to try to make my GazePointDataComponent and UserPresenceComponent persist across scene boundaries. I am using Unity 5.3.2p3.
17/02/2016 at 07:50 #4457DanielParticipantUnity 5.3.2p3 / TobiiEyeXSdk-Unity-1.6.477
So, I made a really nasty workaround to this issue. I am not sure what is causing it, whether the OnApplicationFocus callback is being called in between scenes or there is an issue elsewhere. The following code allows for scene changes to not affect tracking.
private void OnLevelWasLoaded(int level) { EyeXHost.GetInstance().OnApplicationFocus(true); }
- AuthorPosts
- You must be logged in to reply to this topic.