Null Reference Exception when moving blocks

after going through the video I am getting “null reference exception: Object reference not set to an instance of an object CubeEditor.SnapToGrid() (at Assets/CubeEditor.cs:25)” when I move blocks around the scene.
When I click on it it takes me to the CubeEditor script “int gridSize = waypoint.GetGridSize();”

when I move an existing block around it no longer snaps to the grid. However, if i duplicate a block and move that around it snaps to the grid.

1 Like

I am not sure what I did but after running the game it no longer give the Null reference exception error when moving blocks.

1 Like

I was about to suggest you post your code, but it sounds like a Unity Hiccup…

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

Privacy & Terms