- Home /
how to stop moving camera at a certain point ?
hi ! i am new to unity and i have a problem at a point in my game . actually i want to stop camera movement when it reaches the last background this is my scirpt for camera moving : using UnityEngine; using System.Collections;
public class cameracontroller : MonoBehaviour {
public static float offsetx;
// private Camera cam;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(birdmovement.instance != null)
{
movethecamera();
}
}
void movethecamera()
{
Vector3 temp = transform.position;
temp.x = birdmovement.instance.Getposx() + offsetx;
transform.position = temp;
}
} from this script camera is able to follow the player and moving i want to stop my player and camera both . please tell me how can i do this ?
Your answer
Follow this Question
Related Questions
How to solve a problem with UI anchors in Unity 5.2 0 Answers
Shadow bug after upgrading to 5.2 0 Answers
Native rendering plugin OpenGL device type not being set. 2 Answers
Create a Menu before starting AR App 1 Answer
Is it possible to have consistent development for Windows Universal and Android apps? 0 Answers