When trying to use “#nullable enabled” in my project, I get the title error, “error CS1024: Preprocessor directive expected”. I don’t get this same error in visual studio using the same code in another project, just in unity (version 2019.4.2). Any help appreciated
C#8 support was not available in Unity 2019.xxx. The C# 8 specification even came out somewhere in that year. Have a look at this thread , specifically at the replies from the Unity team . I haven’t really used any C#8 features yet. [One of the lastest posts]( https://discussions.unity.com/t/740039 page-7#post-6677038) in that thread states this:
So unless you’re using at least Unity 2020.2+ you can’t expect it to support C#8 features.
Why are so many people chasing the newest shiny features and are still to lazy to check if they are supported.
I’m very new to programming, I hadn’t realized that this was a “new feature” of a new version, sorry.
No harm done I’m just curious how you came across this new C# 8 feature? It seems a bit strange if you’re new to programming that you’re messing around with brand new compiler features -.-
a networking tutorial that was made pretty recently. I was trying to adapt the scripts to run on unity instead of as a console app, but it seems ill need to look at other solutions.
Understand that networking code is the most advanced form of software engineering there is. Any tutorial you want can show you how to blast a packet of data across the internet… that’s not networking.
Networking involves maintaining meaningful synchronized state between disparate computers, along with all of the software mechanisms necessary to ensure synchrony, enforce authentication and authorization, recover from arbitrary data errors along the way, guard against data intercept and manipulation, and many more things.
These two are oil and water. It is like starting with a Mars orbiter mission as an aircraft engineering novice. You’re setting yourself up for failure by jumping straight into one of the most advanced and difficult areas of game development.
I’m following this tutorial to try and adapt it for Unity (atleast the client). Im very new to programming relatively. In total, I’ve been working on unity on and off as a loose hobby for about a year. I have a little experience in C and C++ for other things as well. I understand networking is a very hard topic especially for someone with little experience, but I believe it will be easier for me to implement (not necessarily the entire process of creating it though) a scripting method rather than a high level method like UNet.