Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when importing mathematics in Unity3d

When I try to import mathematics it throws me an error saying that

'' error CS0234: The type or namespace name 'Mathematics' does not exist in the namespace 'Unity' (are you missing an assembly reference?)''

I tried, Using System.Mathematics, Using Unity.Mathematics I also tried by typing Math instead of Mathematics. Idk why this is throwing an error, I use Notepad++ for scripting.

[1]: https://i.sstatic.net/vNs9J.png <--- Error picture

like image 840
Fame Star Avatar asked Sep 17 '25 03:09

Fame Star


1 Answers

You are just missing the Unity.Mathematics Package.

You will have to add the package using Package Manager -

There are 2 ways you can do this -

Solution 1:

a) Go to Unity and launch Package Manager

b) In the Package Manager, you will find a + Symbol then select "Add package from git URL.."

c) Give this Url in the box: https://github.com/Unity-Technologies/Unity.Mathematics.git?path=src and click on Add

If the above Solution 1 is not working for some reason, you can Manually add it

Solution 2

You will have to download the package locally and then install

Download link: https://github.com/Unity-Technologies/Unity.Mathematics/archive/master.zip

Steps to be followed once you download.

a) Extract the zip file using any zip extractor application (Notably WinRar) and note the location.

b) Next, Go to Unity Package Manager and click on "+" Symbol again, But this time Select

"Add package from disk..."

c) Go to the path where you have extracted the package, yourlocation\Unity.Mathematics-master\Unity.Mathematics-master\src\package.json

Select the package.json and click on open

The package will start installing and then it will import the package automatically into project.

It will take sometime to install, if its fails an error would be displayed in your console stating the installation didn't complete. For me Solution 2 had worked perfectly.

like image 157
Suraj Bhandarkar Avatar answered Sep 19 '25 16:09

Suraj Bhandarkar