The steps in this video flat out do not work. I am using Unity 5.4.1f1 on Windows.
You cannot rotate a pin to -90 as he does in the video. If you do, it reports a rotation of -90 in-game rather than 270 like he shows. Worse, this rotation runs you straight into a bizarre problem. When you rotate the pin to -90 or 270 on the X axis, and then you try to rotate it on the y or z axis, you will find that those two axis now act as if they are one and the same when you rotate. So a 30 degree y rotation results in the same physical orientation as a 30 degree rotation on the z axis. I looked up this behavior and found on the Unity Forums that it is a manifestation of the dreaded gimble lock (and that most game engines internally use Quaternions for rotations to avoid this problem).
Additionally, the code detecting that the pins have settled doesn’t work. This is because a further consequence of this setup and the gimble lock problem is that in-game you will notice that the rotation on the y and z axis both fluctuate wildly from -60 to 60 (or something like that) on each pin.
I have no idea how Ben made this video without running into this incredibly serious show-stopper of a problem! I’m also surprised no one else has commented about this issue either. Surely I can’t be the only one experiencing it, right?
Luckily, there is a fairly simple way to fix this issue. Create an empty object and put it inside the Pins group object. Reset its transform to 0,0,0. Copy the values of the pin’s transform component onto this new object. Now parent Pin 1 to this object. Change Pin 1’s X-axis rotation to 0 (reset its transform since it’s position should be 0,0,0 relative to the parent). Set the rotation of its new parent object to -90 or 270 on the X-axis. Now the rotation properties behave normally in-game. Edit the IsStanding() method in the Pin script and remove the “270 -” that he added in this video. Change the code for the Z-axis to target the Y-axis instead, because Z is now the vertical axis due to that initial 90 degree rotation. Lastly, go to the line in the IsStanding() method that gets the rotation and change “.EulerAngles” to “.LocalEulerAngles” so we get the local angles without the parent transform added in. Repeat for the other 9 pins. So basically, we’re just giving each pin a parent object again, and putting the rotation onto that parent. Then the pin’s rotation is completely independent of that initial -90 degree rotation, preventing the gimble lock issue from rearing its ugly head!
By the way, I did not experience any of the other issues people have mentioned in here as I followed the video. The renderer is still there on my pins and scaling is fine.