My character was not moving, when I tried to fix it I broke the code

As in, a whole mess of red lines like here.

There were some errors that I fixed on my own instead of making posts. I was able get “Nothing to do here to print” but my character was not moving. I couldn’t find out what was the issue, so I copy and pasted the Git repo into my code, but it broke everything.

I’m confused because I thought the lecture notes were the “correct” code to use in case things went wrong? I have been double-checking my code against that and the video.

I think I fixed this by cut and pasting the NEXT lesson’s code.

The issue is that you appear to have pasted a method into the middle of another method…

If you take a look at the first private void Update(), you’ll notice that you have an opening brace, but before you have a closing brace, you have another private void Update() and a whole method in there. The compiler can’t make heads or tails of this because it still thinks you’re in the first Update method.

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

Privacy & Terms