- Home /
I keep getting this error?
I don't know how to fix this error I keep getting
"Assets/Standard Assets (Mobile)/Scripts/Joystick.js(90,20): BCW0012: WARNING: 'UnityEngine.GameObject.active' is obsolete. GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy. "
I'm not even using the mobile assets and the error is there? How do I fix this.
Is it affecting your game? All it means is your using gameObject.active and Unity would rather you use something else. It should just be an idle warning, and if its not stopping you going into game mode, you should be fine.
It's a warning, not an error. That means you can ignore it, though ideally you would fix it since it may cause problems in the future.
Answer by Statement · Apr 03, 2013 at 04:36 PM
Well, you clearly have the Standard Assets for Mobile, which contains the joystick script. Otherwise that (Assets/Standard Assets (Mobile)/Scripts/Joystick.js) wouldn't show in the log. If you are using them or not doesn't matter since the code will still get compiled.
The log message also suggests how you should fix the issue:
Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.
If you aren't using the mobile assets, then you should consider removing them from your project.
If you want to work around the issue, then remove any references to gameObject.active etc, and replace them with GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy as suited.
The log is displayed because that code is referencing members that have been deprecated.
Thanks! I'm kind of new to Unity and such so.. yea. Thanks!
Did you upgrade your project from Unity 3 to Unity 4 or did you just start a new project with Unity 4 and got that error? In such case I would suggest that you report a bug.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
BCE0044: expecting EOF, found '}'. 1 Answer
ASAP HELPUnity Engine Physics is required access non static member!!! 1 Answer
Multiplayer Script ERROR WTF 1 Answer
Block Collision Sliding off 0 Answers