Quantcast
Channel: Answers for "How do I lock Y Axis movement for Parented Camera?"
Viewing all articles
Browse latest Browse all 6

Answer by MrWhoof

$
0
0
If you really just need a super simple camera that follows only along X (once you move past parenting), this will do it for you, and is easy to grow from. var player : GameObject; var depthOffset = -10; var verticalOffset = 0; function Update () { transform.position.z = depthOffset; transform.position.y = verticalOffset; transform.position.x = player.transform.position.x; } Drag the player character onto the Player variable in the Inspector, and it'll just work. Adjust your offset parameters as needed.

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images