Two days ago, I started using the Unity3D game development tool. Interestingly, Unity3D is the most pervasive tool in the Game Dev industry... it is everywhere. I've been making games since 1982, but have never used it before.
I'm one of those dinosaurs keeping to the old way of doing things, and making my own game engines. Think of a manual 3-gear transmission Willys Jeep instead of heated seats, 7 cup-holder, navsat SUV.
So far, I like it better than I thought I would. In this blog article, I will collect some gotchas, insights, surprises that I will undoubtedly encounter.
- Project loads are slow. Once inside the editor, make sure you stop "Playback" before editing anything... all edits during playback will be lost.
- Unity uses degrees, not radians for angles.
- You can only use const for compile-time constants. Not for run-time constants, like C and C++.
- Unity physics is a wrapper over PhysX. Neither uses ERP and CFM like OpenDE and Bullet Physics do.
- Unity debug output prints vectors with low precision. So (0.0, 0.3, 1.0) can actually be unit length!
- My bicycle wheel would not spin faster than 7 radians per second, no matter how much torque I applied to it. It turns out that there is a rigid body property that caps it.
- There is no include directive in the C# language. Instead, files that using the same namespace will automagically find each other's definitions.
- Centre of mass and inertia tensor are automatically computed from the collision geometry! Beware of this: simulation results will be different just by changing collision geometry, unless you set c.o.m. and inertia explicitly.
- Monobehaviour.Awake() is called in random order for the Gameobjects. Ugh.