Home › Forums › Software Development › Highlight at Gaze and Presumably Tobii Fail after SceneManage.LoadScene
- This topic has 5 replies, 2 voices, and was last updated 3 years, 11 months ago by Grant [Tobii].
- AuthorPosts
- 04/11/2020 at 22:08 #19227Luke EppParticipant
On Unity 2019.3.6, Pico SDK 2.3 -2.8.6, and Tobii SDK 2.0.0.174. Using the highlightAtGaze script to test out Tobii on the Pico Neo 2 Eye, it works well before SceneManager.LoadScene is called, but after that. Tobii and HighlightAtGaze do not work, weirdly if I exit out of the application on the Pico device and jump back in, Tobii is active and HighlightAtGaze works. This is confusing to me and I have tried calling TobiiXR.Start() in many places to try to workaround. Any help is greatly appreciated, thanks!
05/11/2020 at 12:26 #19233Grant [Tobii]KeymasterHi @leppster13, and thanks for your query. There are a number of ways to enable eye tracking between scenes.
One way is to have the TobiiXR_Initializer prefab in the start scene and make it DontDestroyOnLoad, another way is to have one initializer per scene. You can also make either of these setups work dynamically in code. If you could kindly clarify what you are trying to achieve we will be better placed to assist you further. Best Wishes
05/11/2020 at 20:19 #19235Luke EppParticipantHey Grant, thanks for the help. I am just trying to reload the start scene in my case. I now have the TobiiXR_Initializer awake function looking like `private void Awake()
{
DontDestroyOnLoad(gameObject);
TobiiXR.Start(Settings);}`
but I am still running into the same issue. Is it possible that I need to do something with the objects with the HighlightAtGaze script attached to them? Thanks again.10/11/2020 at 12:53 #19270Grant [Tobii]KeymasterHi @leppster13, for basic eye-tracking usage in one scene reloading in the next scene, you can just add the “TobiiXR_Initializer”-prefab in the Prefabs-folder to the scene and it will work. No need to add anything in code. Please try this out and let us know how you get on. Best Wishes.
10/11/2020 at 19:44 #19273Luke EppParticipantHello, I have actually solved this now and it seems that
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
does not play nicely with what I was doing. A switch toSceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
fixes the issue. Thank you for the help.11/11/2020 at 10:54 #19279Grant [Tobii]KeymasterGreat! Glad to hear you got it all up and running, happy to help. Please don’t hesitate to get in touch again should you require any further assistance. Best Wishes.
- AuthorPosts
- You must be logged in to reply to this topic.