Counting Hits and Visual Studio

Is there going to be any attempt to update this course using Visual Studio? Its hard enough to learn code and all I do is chase my tail trying to find code fixes in Visual Studio because the MonoDevelop syntax is obsolete. I can’t even use public int maxHits; etc - exactly the same code in monodevelop and have it even show up in Unity 2017. Its been the same issues over and over so far in this course. yeah this turned into a rant and I will find the right place to give feedback on this course which is turning me off to game design.

I have started a couple of months ago with Unity 5.2 (now 5.3) and always used Visual Studio. But I don’t think Visual Studio matters, for all I know you can use notepad to write the code.

Some things are different for different Unity versions:

I do understand your feeling. I have started this course with little to no programming experience (and what I had was 30 years outdated) and have fought my share of lonely battles against invisible untraceable errors and bugs. Sometimes you are encountering something difficult, sometimes all you need is a missing capital that you overlooked.

Try to give us a some examples to help you work on your game. Lecture 5, on asking good question, might provide some insights for you. I really appreciated that lecture, highly recommended.

(again, I know your pain, feel free to message me if you want)

The syntax like declaring fields like public int maxHits should be the same. The IDE (like Monodevelop or Visual Studio) shouldn’t matter. Like Duckfest said there are some changes in the UnityEngine with the newer Versions.

If you are using Visual Studio 2017 and did not install the Unity Extensions you will have problems with opening Visual Studio with Unity and debug your code in Visual Studio.

If you absolutly don’t like Visual Studio you can go to Edit->Preferences->External Tools and change back from Visual Studio to Monodevelop or an IDE of your choice, that you have installed.

Thanks for the links and suggestions. I got everything working again. When I write and save a script in visual studio there is a delay (when you declare something public) for it to show up in Unity. I deleted my script and reopened Unity - then created the script again and it worked. Well maxHits and timesHit appeared but timesHit still wouldnt count but I put in a print “you hit me” to know that there was a collision. So to be honest I have no idea what the issue is with timesHit not displaying (counting). But its working and I’m onto the next lesson. thanks again.

Although you’ve added the code it doesn’t appear in Unity until the file is rebuilt or saved. After updating the code just hit F6 and it builds the code and assuming there’s no errors it will appear in Unity pretty much instantly. At least that’s been my experience since switching to 2017.

Privacy & Terms