Hi, I’ve been following a tutorial on Cat Like Coding and have run into a snag: Marching Squares, a Unity C# Tutorial
The tutorial is asking me to create this individual class script removing Mono-behavior from it and then call the new Class type from another script. VoxelStencil does not seem to have made a connection to my other classes. Chopping out Mono-behavior is unfamiliar territory for me.
Did you try in your class something like that?
public VoxelStencil voxelStencil = new VoxelStencil () ;
Otherwise I am not sure, what you mean.
I have the class on a separate script file. When I attempt to use that class with the line in the other script I wish to use it:
VoxelStencil activeStencil = new VoxelStencil();
‘The type or namespace name ‘VoxelStencil’ could not be found’
Hey, erm, it seems to have fixed itself.
Restarting Unity seems to have sorted out the relationship… Sorry bout that =D
I was looking on the Solution explorer on the right and noticed the script was showing the position it was originally created at the top of the assets folder and not showing it with its neighbors.
Reopened the project and it synced.
Perhaps you haven’t initially refreshed Unity editor, after creating / editing script?
Ctrl + R to refresh scripts / assets.
1 Like