I want to make a 2D bmx game like the ones on http://teagames.com. I have tried using a car tutorial, removing wheels and deleting the turning script yet the car still sometimes moves along the z-axis when I crash or reverse direction quickly. I guess this is something to do with rigidbody physics and I would like to know how I would do this in "real" 2D as Ive noticed with the "2D" tutorial on the unity website that the physics arnt actually 2d, just the object only move in 2 planes.
Thanks in advance.
asked Oct 26 '10 at 07:15 PM
Unity will always be in 3D. It is up to how you setup your camera and its properties that determine if you want it to look '2D' or '3D'.
To restrict your bike on the Z axis. Simply do something like the following in your FixedUpdate() method on your bike script.
Where currentPositionX and currentPositionY are the bikes positions you set, and notice the Z is set to 0. Meaning it will always stay at 0 on the Z axis.
answered Mar 31 '11 at 10:37 AM
Well, unity is a 3D engine but you could try declaring the z value again every frame?
answered Oct 26 '10 at 08:59 PM