- Home /
dose DontDestroyOnLoad works on android?
Hi everyone.Its an app that each button opens new scene and use an gameobject to gather all variables and use them in other scenes . the app works fine on my pc but not on the Android phone after the build .other scenes are just empty ,i used WWW and yield and also DontDestroyOnLoad (this);Is it working on Android ?
Answer by xKroniK13x · Apr 16, 2013 at 03:42 PM
I'm using it in an android application without an issue, all of the things you mentioned should be fine. I'm using WWW and Yield for downloads, as well as DontDestroyOnLoad on an object that holds user information.
thank you for your reply,i found the problem but did not solve it yet , i have used var sw = new StreamWriter ("testFile.txt"); sw.WriteLine (hs_get.text); sw.Close(); that needs to write the file , on windows it write it to the project folder ,i have to find a way on the phone , will appreciate if you have any idea .
Are you using Application.dataPath
for your save location? If so, you have to make it Application.persistantDataPath
for iOS and Android. This makes it save in the directory of the app, which has ample permissions.
Your answer
Follow this Question
Related Questions
Problem with creating an app with Augmented reality 1 Answer
Adding pro-guard to android unity project 0 Answers
Unity Android app crashes on S3 and Note2 1 Answer
Fix for published android game crashing 0 Answers
Restore Purchases complete event 0 Answers