C# In Unity | Namespaces

Rehtse Studio
Aug 7, 2021

Use namespace on your Unity scrips.

This will help you not have errors if you tend to download asset from the unity store or from a git repository and by oops they have the same name scripts as you.

With namespace or without you still can’t named two scripts with the same name if there in the same folder, it will add a 1 at the end of the name. BUT If you have two script in different folder with the same name you will get a error.

Can’t have two script with the same name on the same folder location
Error on Console if you have two scripts with the same name, on different folder location BUT none of them has a namespace.
Error on scrips, they shared the same name on different folder location but none of them has a namespace.

If your using namespace and you need a reference to the script you need to add `using [NameOfTheNamespace]` on top of your scripts.

Short article but hope this tips helps you out.

TO BE CONTINUED 😎

--

--

Rehtse Studio

Game Developer sharing content around Unity, programing and tips and tricks in game dev.