Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

One out of N PlayerStarts ignored

In a FirstPersonCamera game, I have a scene with eight different Hotspots switching/fading to eight different other scenes and also eight different PlayerStarts (that differ only in Y-RotationAngle) which shall get activated depending on the previous scene the player comes back from.

This works for seven out of eight of these PlayerStarts, but for the eighth one, it doesn't; instead the screen fades back to the default PlayerStart and then, after finishing the fade, it "jumpcuts" to the correct PlayerStart for this previous scene.

I believe I have checked every possible parameter and that all PlayerStart scripts are set up as they should but I cannot find the reason for this misbehavior; any ideas what could be causing this glitch?

Thank you.

Comments

  • More detail will be needed in order to properly help:
    • What versions of AC and Unity?
    • If you add a ninth PlayerStart / scene, does that work - ie. is it just the 8th, or all above 7?
    • You can see what ActionLists are running at any time by checking List active ActionLists in Game window? at the bottom of the Settings Manager.  Is anything running at the time of the "jump-cut"?
    • The player shouldn't teleport after the fade-in unless you manually tell it to - try stripping away all OnStart Actions etc so that there's no logic running when the scene begins
    • Are you making use of multiple player prefabs, or using player objects that are saved in your scene?
    • You mention parameters - which specifically are you referring to?  Action parameters?
    • Is the 8th scene listed in the build settings?  Does it have a unique filename?
  • edited October 2016
    Hey Chris,

    thanks for getting back to me so quickly!

    I actually got this to work by adding an additional GameCamera that has exactly the same Transform values as the notorious PlayerStart No.8; I entered it in the Camera Setting of the PlayerStart Script as "Camera on start".

    What troubles me: all the other PlayerStart Scripts still have either the standard GameCame or even "None" set for "Camera on start" … and they still work! I don't know – is this working accidentally?

    I seem to have problems truly understanding the logic of what needs to be set up in a FirstPersonCamera environment altogether. My understanding so far was:
    • Except for Cutscenes, GameCameras get ignored. The Player's position is solely determined by the FirstPersonPlayer prefab (with a Camera as child) and an active PlayerStart.
    • Except for Cutscenes, the number of GameCameras do not matter, meaning: one is enough. It is just required to enter something into the SceneManager's "Default Camera" box. 
    But if so: why is there both a "Default PlayerStart" box and a "Default Camera" box in the Scene Manager, if GameCameras do not matter outside of Cutscenes?

    So before adding this additional GameCamera for the one PlayerStart that got ignored so far, I only had one GameCamera in my scene and eight PlayerStarts, seven of which have different values than the default PlayerStart – which adds up to two GameCameras.

    So while I am happy that it works now, I do not understand why. Or rather, why the other six PlayerStarts work without six corresponding GameCameras with equal Transform values.

    As regards your questions:
    • I am running Unity 5.4.1f1 and AC 1.54b.
    • A ninth and tenth PlayerStart worked well without setting a specific GameCamera in the PlayerStart Script too.
    • At the time of the jumpcut, a "Scene:Switch" action has just finished; it led the Player to the standard GameCamera Transform and then jumped to the (then) different PlayerStart Transform values.
    • I did have quite a pile of OnStart actions but removing them didn't change anything. The only action I could not strip OnStart was "Engine:Manage Systems" in order to change from the previous scene's movement method:none to :first person. But this happens in the other seven scene switches as well – and works there.
    • No, there are no multiple player prefabs or player objects in the scene.
    • When I said "parameters", I meant the Transform values - sorry for the confusion in terminology.
    • Yes, the 8th scene was listed in the build settings and did have a unique filename. However, it initially contained an Umlaut, so I renamed it later on as I suspected this Umlaut being a source for trouble – with the effect that the Umlaut-version was still listed in the build settings after renaming, but was greyed out (and unresponsive too – I could not delete it from the list). So I re-added a scene with the old name which reactivated the entry in the build settings; after that, I could properly delete it.
    As I mentioned: I am almost sure that as far as a FirstPersonPlayer setup is concerned, I have not really understood the entire network of relationships between
    • GameCamera and when its values matter
    • Main Camera (and what its LookAt child actually is)
    • Default PlayerStart (in contrast to Default Camera) in the Scene Manager
    • "Camera on Start" in the PlayerStart Script (which should be one and the same thing like the PlayerStart in FirstPersonMode – no?)
    And I wonder: should I generally add one additional GameCamera for each and every PlayerStart with exactly the same Transform values and enter it in their "Camera on start" boxes? So far, it has seemed sort of repetitive and redundant to me, but maybe that is what I have been missing …

    Best, Jens
  • You're correct that, when it comes to First Person games, GameCameras are only used during cutscenes (i.e. when control is taken away from the player).  I suspect that the issue is being caused by a gameplay-blocking Cutscene being run when the scene runs, and so the camera is being cut to.  Know that you can always check which GameCamera is activated (including the First Person Camera) at any time by viewing the MainCamera Inspector while the game is running.

    If so, see if you can change your OnStart Cutscene's When running field to Run In Background.  This will prevent control being taken away from the player, and so prevent the GameCamera being switched to.

    About the way AC / First Person mode works:
    • The Default Camera field in the Scene Manager is listed there for convenience - it's really just a copy of the Camera on start field for the PlayerStart that's assigned as the default.
    • The Default PlayerStart is only used if the game begins from this scene, or if no more appropriate PlayerStart is found given the previous scene.
    • A PlayerStart's Camera on start does not need to be unique - all of them can share the same GameCamera.
    • When the scene begins, the player prefab will be moved to the relevant PlayerStart.  In non-First Person games, or if the scene begins with a gameplay-blocking Cutscene, the camera is set to be that PlayerStart's Camera on start.
    • AC's GameCameras and other Camera scripts (such as First Person Camera) are never used to render their associated Unity camera directly.  Instead, when one is made "active", the MainCamera copies their values and does the actual rendering.  In that sense, all cameras but the MainCamera are merely used as reference.
    • The MainCamera's "LookAt" child is used to rotate the camera with the cursor position, which is a feature only some GameCameras allow.  AC will handle it and you can ignore it when working.

    Hope that helps clear things up a bit.

  • Yes, it did, Chris – much more than just a bit! Thank you so much.
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.