I am trying to make a camera that acts like the camera in super smash bros.
It will keep all players on screen by moving horizontally and vertically, and by zooming in and out.
(edited for brevity. click the history button if you need to see it for some reason)
Any help would be appreciated. Thank you in advance.
My suggestion : You need to do tutorials provided by unity http://unity3d.com/learn/tutorials
public bool canFocus = true ;
//You could play with the zoomValue in inspector in play mode
[Range(1f , 100f)]
public float zoomValue ;
private Camera _camera ;
void Start()
{
if (!_camera)
_camera = Camera.main ;
}
void Update()
{
if (canFocus)
{
//call the function from below as per your camera ;
}
}
//Orthographic projection is used for 2D games
void FocusInOrthographicView()
{
//See your Main Camera setting If the projection is set to Orthographic use this
_camera.orthographicSize = zoomValue ;
}
//Perspective projection is used for 3D games
void FocusInPerspectiveView()
{
//Is the projection is set to Perspective use this
_camera.fieldofView = zoomValue ;
}
The Tanks tutorial has exactly this type of camera, you should be able to adapt it to your needs quite easily.