Removing Namespaces from default scripts ... is it safe ?

Hi all,

I am not an expert in scripting and the Unity structure is still a bit obscure to me. I am currently trying to check for events I created in my game from inside the FirstPersonController script that comes with Unity.

I think that due to the class being part of its own namespace it can’t detect events which I created in my other scripts.

Is it safe to remove that namespace so that I can access my events in the FirstPersonController class ?

The main use for namespace is to prevent naming conflicts and,as already mentioned, to organise things. Removing namespaces from a tightly packed system, like it is the case for Unity, will most likely result in a ton of issues across the board.

TL;DR: No it’s not safe to remove namespaces from default scripts.

In your case, there are probably some underlying issues in the way you trigger and subscribe to your own events. Creating and using a custom event system might be a little to much for you at the moment and you might be better of using the callbacks that are provided by Unity.

Yes, Namespaces are used to organise code.