Forum rules - please read before posting.

Camera Switch/Target Object Issue

Hi, I've run into a problem with the Game Camera 2D and didn't see anything in the forums related to this

When the player clicks an interaction that switches the camera, the "Target Object to control camera movement" no longer affects the position of the new camera, even though both cameras have the same movement settings and same Target. 

I'm not using the Player as the target, it's following an empty gameobject with a script that updates the object's position relative to the players mouse position. It works fine until the camera switches, then the movement stops, even if both cameras have the same movement settings.

void Update () {

transform.position = Camera.main.ScreenToWorldPoint (Input.mousePosition);

}

Script still works after the camera switch. So for some reason the new camera won't follow the target

Comments

  • Which versions of AC / Unity are you using?  I will attempt to recreate the issue.
  • Can't get a problem to occur myself.  Please update to the latest AC if you haven't already, and then post more detail: Are you transitioning to the new camera over time?  Are you changing the target field dynamically through script?  Any screenshots you can provide will help find the source of the issue.

    Check that the cameras themselves aren't moving - normally you'll only view through the MainCamera, which copies the active camera's properties.  It may be that the cameras are moving, but the MainCamera is not.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.