- Home /
Strange error when adding script.
Hi All,
I'm getting this error when trying to add a script to my scene. The script is specifically the radar script found here; http://www.unifycommunity.com/wiki/index.php?title=Radar
The error I'm getting is; "IsD3D9DeviceLost() || g_D3DInsideScene".
Once it appears the selection inside the editor goes crazy then eventually stops responding altogether before closing down.
Can anyone tell me what's going on as I assume it's not the script and maybe something to do with my system?
Any help is appreciated.
Answer by Willem · Aug 17, 2010 at 10:22 PM
Looks like an error that is caused by Unity loosing its handle to Direct X. What OS and version of Unity are you running? Also which radar script are you trying to attach?
I was getting this error using the java script. I'm running Windows 7 x64 and Unity Ver2.6. I've since tried the c# version of the script and haven't had any problems.
Answer by SteveFSP · Aug 18, 2010 at 05:01 PM
This is a very long shot, but since it appears you haven't gotten an answer yet...
Are you using the C# version of the script? A while back I experienced the same symptoms you are experiencing. Drove me crazy for a bit. I was able to resolve the issue by removing the explicit type definitions from my enum declarations. So if you are using C#, try removing the explicit enum type from both of the enum declarations:
E.g. From:
public enum RadarTypes : int {Textured, Round, Transparent};
To:
public enum RadarTypes {Textured, Round, Transparent};
Funnily enough it was the java version of the script that was giving me the error. As I said to Willem, the c# version is working fine. Thanks for the responses guys; I guess there isn't a simple answer to the error.