Can't use WaypointCircuit script - using Unity 2019

I have picked the course up a year after completing up to end of Project Boost. Back then I was using Unity 2017, but as I have rebuilt my PC, I had to reinstall so went with Unity 2019 this time. Absolutely love the course and the teaching style!

I have started Argon Assault, and got up to lecture 82 without any issues I could not solve. However, I am trying to implement the WaypointCircuit script and having trouble now. I figured out that I have to import the standard utility assets from the asset store as they are not now available in the menu by default. However, I am stuck at the point of trying to attach the WaypointCircuit.cs to the Circuit game object. The script (which has appeared in my assets) does not come up under search like it does in the lecture video. I tried dragging it onto the Circuit game object and I get an error:

Can’t add script component “WaypointCircuit” because the script class cannot be found. Make sure that there are no compile errors and the file name and class name match.

I have Googled around a bit, checked that the script does have the same class name as the file name, tried restarting Unity, but to no avail, bit stuck what to do!

Would be really grateful if anyone can help. Wondering if I should just start again in Unity 2017, but am keen to do this in the latest version and figure out the issues where there are differences to the course lectures. So far have managed to do this without asking for help, but a bit stuck now…

Thanks a lot!

1 Like

Hmmm. Have now found this similar issue: [Solved] Need Help with Script Error

Not sure how to access the lecture about “Fixing Visual Studio Issues”. It is not lecture #16 as it says here, tried searching the course content but can’t find it.

I do have this error in my Console:

Error detecting Visual Studio installations: ApplicationName=‘D:\My Documents\Matt’s Files\Unity Course (Udemy)\4_Rail_Shooter\Library\PackageCache\com.unity.ide.visualstudio@1.0.5/Editor/VSWhere/vswhere.exe’, CommandLine=’-prerelease -property productPath’, CurrentDirectory=’’, Native error= The system cannot find the file specified.

at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in :0
at System.Diagnostics.Process.Start () [0x0003a] in :0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
at VisualStudioEditor.VSEditor+d__1.MoveNext () [0x00106] in D:\My Documents\Matt’s Files\Unity Course (Udemy)\4_Rail_Shooter\Library\PackageCache\com.unity.ide.visualstudio@1.0.5\Editor\VSEditor.cs:57
at System.Collections.Generic.LargeArrayBuilder1[T].AddRange (System.Collections.Generic.IEnumerable1[T] items) [0x0005e] in :0
at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable1[T] source) [0x00033] in <b7efe7e6e548497fac3c4a6049a0a4b6>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00018] in :0
at VisualStudioEditor.VSEditor.GetInstalledVisualStudios () [0x00099] in D:\My Documents\Matt’s Files\Unity Course (Udemy)\4_Rail_Shooter\Library\PackageCache\com.unity.ide.visualstudio@1.0.5\Editor\VSEditor.cs:231
at VisualStudioEditor.VSEditor…cctor () [0x00022] in D:\My Documents\Matt’s Files\Unity Course (Udemy)\4_Rail_Shooter\Library\PackageCache\com.unity.ide.visualstudio@1.0.5\Editor\VSEditor.cs:70
UnityEngine.Debug:Log(Object)
VisualStudioEditor.VSEditor:.cctor() (at Library/PackageCache/com.unity.ide.visualstudio@1.0.5/Editor/VSEditor.cs:74)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type)

I think this is likely the problem, how do I fix this…!?

Fixed it myself, sorry!

It wasn’t my VS error that was the issue, though I would like to know why I am getting that.

I was also getting some errors about other standard assets - namely Cross Platform Input. I had only imported the Utility section. I have now imported the whole standard assets package, those errors went away on a restart of Unity and I can assign the script to my game object.

Woohoo! Funny how asking for help on a forum helps to help yourself sometime.

Maybe this will be useful for someone else in the future…

1 Like

Well done on posting your first issue, resolving it and remembering to mark it as such! Very cool. Welcome to the forum.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms