Transform.forward

When I use transform.forward, it returns (0.0 , 0.0, 1.0). How do I get around this to where it actually gets the forward direction?

I’m fairly certain that Forward is along the local z axis. If your object isn’t moving the direction you want check that it’s local z-axis aligns with the ‘front’ of your character

How would I find the forward dir of a 2D Game where there is no Z Axis?

Use a different axis other than forward or author content so that z points along x. It’s common sense, not a mystery or anything.

2D works on x,y therefore your gameobject will always be 1 along z unless you rotate your game object. Alternatively, use transform.right or -transform.right

1 Like

By default 2D is set up to use left, right, up and down. A 2D side scroller uses transform.right much the same way as 3D uses transform.forward.