- Home /
Camera problems in SideScrolling
Ok first of all, lets get this clear, im a total noob with just 1 week working on this. What im trying to accomplish is some kind of Teenage Mutant Ninja Turtles (TMNT) kind of game, but with 3D models, and, not a brawler game, a shooter instead. First of all, this youtube video explains very well what im trying to make: http://www.youtube.com/watch?v=5XIdm22lPUc ... Amazing huh? , now add shotguns , assault rifles and tanks to that and we got something.
My problem with that is the camera, i dont know how they dame that one up (elevation from the platform, angle of inclination, separation from the platform). After many tries, i've come up with this: http://imageshack.us/photo/my-images/64/screenshot1rx.jpg/
But in the edges im still unable to simulate the camera style in the video. Im looking for someone experienced in this camera style to calibrate the Angle of the camera in the Z Axis (asuming the player is moving on the X and Z axis and Jumping in the Y axis), also elevation and distance from platform.
Answer by Clunk · Sep 19, 2011 at 05:51 PM
Attach this to you camera. Make sure the object you want it to follow is Tagged as "Player". After you attach this script to the camera, you need to select the cam and set the "Offset" variable in the inspector.
var cam_offset : Vector3;
private var player : GameObject;
function Start()
{
player = gameObject.FindGameObjectWithTag("Player");
}
function Update()
{
transform.position = player.transform.position + cam_offset;
transform.LookAt(player.transform);
}