Why is C# used primarily in most game engines and not C++?

What you're saying is the opposite of the truth really. If you look at games programming jobs, you'll find that 80-90% of them stipulate working knowledge of C++.

To answer the question in the opposite way to the way you phrased it, C++ makes the program faster, c# makes the programmer faster (vast oversimplification). You'll find more engines used widely by hobbyists will use C#, Java, Python or similar languages because they provide a faster work environment for the developers.

It's hard to quantify the performance differences between C++ and C# as the answer is dependant on the situation but to give a prominent example, garbage collection. In C++, you have to allocated and deallocate memory manually whereas a language like C# uses a garbage collector to do this for you. If you mess up memory allocation in C++, you'll end up with memory leaks whereas, in C#, your program will just run worse due to the garbage collector having a higher load.

These differences just make C# easier and quicker to work with at the cost of performance, hence why you'll find most hobbyists will use it or another similar language. Unreal is the most popular engine to use C++ as it's scripting language but it also has its own garbage collector built in for ease of use (as well as blueprints)

/r/Unity3D Thread