Question by
dark_energy_10 · Jul 11, 2019 at 02:17 PM ·
cameraplayercamera-movementplayer movement
my movement doesn't work after adding "follow player" script to camera
this is my follow player script public Transform camera; public Transform player; bool cameraMovCheck;
void Start () {
cameraMovCheck = GetComponent<movement>().cameraMovCheck;
}
// Update is called once per frame
void Update () {
cameraMovCheck = GetComponent<movement>().cameraMovCheck;
if (cameraMovCheck == true)
{
camera.position += new Vector3(0, 0.5f,0);
}
}
in playerMovement script ,all i did was used "onBecomeVisible() and onBecomeInvible" function which sends a bool value to followPlayer script.playerMovement works fine if i un check followPlayer script.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612204717im_/https://answers.unity.com/themes/thub/images/avi.jpg)