Forum rules - please read before posting.

How to let the camera automatically switch character when player switching

edited July 2020 in Technical Q&A

Hello

I followed the new tutorial on player switching ( https://adventurecreator.org/tutorials/player-switching-workflow )
but I still have one issue:
when I switch the player, the camera stay on the old character.

With the old player switching method I didn't have any problem.
What's changed? How can I set the camera automatically switching the character when the player is switched?

If you need something about my project to better understand, don't hesitate to ask me.

Thank you,
Mirko

Comments

  • Have you previously played as the new character earlier in the game, or is then when switching to them for the first time?

    Check the Console for messages. You may need to ensure that all involved cameras have Constant ID components attached to them.

  • Yes I played before the last update, when the player switching method changed.

    Before that update, everything was working fine: the camera followed the player.

    Now when i switch the player, the camera stay on the first player.
    But I noticed that, while gaming, if I switch player, the transform component on the camera, is changing properties according to the position of the new player. SO in a certain way, it is working, BUT what I see, is that the view is locked on the first player.

    Here the inspector of the camera.
    https://imgur.com/a/p3OonqY

    (I actually have 3 cameras that differ only on the size - i'm using it for zooming in and out - but I don't think that's the problem)

  • Yes I played before the last update, when the player switching method changed.

    No, I mean have you played as the character before in this game, i.e. you were Player B, then Player A, then Player B again?

    If this is the first time you switch to Player B, have you used the Player: Teleport inactive Action to change their position? If not, then they're starting position / camera will depend on the "Start data" you set them in the Settings Manager.

    What is this currently set to, and does the PlayerStart they're supposed to start at have an associated camera?

    What does the Console say?

  • What is this currently set to, and does the PlayerStart they're supposed to start at have an associated camera?

    I didn't get the question.

    The console does not say anything.

    BUT I have news:
    I think the problem is that I have an "Object:Teleport" to teleport the player in the beginning cutscene.

    I tried to remove the cutscene.

    Then everything worked fine.

    Then I tried to add again the cutscene

    Just to try, I went to character settings in settings manager, i clicked on "find reference" in the first character, but didn't do anything. ( I've already edited "start data" before, in the correct way, for the second character )

    And now everything is working good! really don't understand why.

    So, it seems everything was solved by themself, but still i'm not sure this will work forever, because I don't know what changed.

    If I have again the same problem, I'll write here.

    So far, thank you a lot!!

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.