how do i add values to my variable offset because the camera looks directly in first person i am not making an fps and if i was i would have to still make a turn camera function. but back to the point how to i make the camera’s ZED, and X access to zoom out a bit on my sphere
///CODE BELOW/\\\
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour
{
//The target player object
public GameObject player;
//The offset distance at which camera should stay
private Vector3 offset;
void start()
{
//This will calculate the gap between player and camera at startup
offset = transform.position - player.transform.position;
}
void LateUpdate()
{
//Update camera position based on player position
Vector3 Cameraposition = player.transform.position - offset ;
//Apply the final position
transform.position = Cameraposition;
}
please use [code ][/code ] tags when pasting code into the forums, really helps with readability, add lines numbers (helps with error messages which also have line numbers) etc., there is a sticky on them at the top of the scripting forum.
I’ve read you’re message above your code a few times and I’m not entirely sure what you are trying to do perhaps tell us what you are trying to do rather than what you aren’t?
Even if you might not need the character related stuff, the “TP_Camera” related video might help you out. I still suggest watching the whole thing to get a better overview of everything you need or not from it.