Forum rules - please read before posting.

Scene switching player/camera problem (3d game)

edited October 2017 in Technical Q&A
I have noticed that when I access my main scene gameplay (first scene I added adventure creator too) from another scene, my player is surrounded by blue sky without any land in sight. The screen also glitches a bit (it's not smooth falling), and I can still look around in first person and see the players feet. I thought maybe a rigidbody wasn't attached, but it is, and it works fine when I just play (or build) the main scene without arriving to main scene from other scene. The OnStart cutscene in the main scene always works. The problem just starts on Gameplay after switching from another scene.

Under 'Settings' I have noticed that the movement setting has an effect. If set to 'Direct' or 'None', the default camera I defined under the Scene tab is used when gameplay starts. However, if I use first-person movement settings (my preference), that's when it switches to the blue sky and main first person camera, which is attached to the player defined under settings - again, only when gameplay starts.

Ideas are welcome thankyou :-) 

Comments

  • Welcome to the community, @akacheese.

    Which version of AC are you using?

    If the First Person movement option is chosen, then the Player's First Person Camera will be automatically switched to during regular gameplay - as covered by the "First Person" chapter of the Manual.

    When the issue occurs, pause the game so that you can then view the situation in the Scene window.  Is the First Person Camera in the correct position relative to the Player?  Where is the Player relative to the rest of the scene?

    When entering from another scene, AC will rely on the most appropriate PlayerStart it can find to position the player.  Do you have one set up to respond from the previous scene?

    So that we can determine if this is an issue with the player, or with the scene, temporarily assign "Tin Pot" (from the Demo game's Resources folder) as the game's Player - as he's equipped to work in First Person as well.  What is the result of that?

    If you can provide screenshots to illustrate the scenario as well, that will help a lot to better understand the problem.
  • Thanks @ChrisIceBox! Have been lurking for a while.

    Good idea, didn't think to pause it before checking scene window! That helps. 
    The player falls straight down with the sky (Tin Pot does too). The player is centered on the sky like one is a child of the other.
    For the sky, I use the Asset 'AzureSkyController' which is a great asset aside from this.
    When I deselect the AzureSky assets from the Hierarchy or delete the asset completely, it still does the same thing with the player free falling.

    When I removed all PlayerStarts in other scenes and the problem still occured.

    Here are a couple of screenshots 1s after gameplay starts.

    How can I tell what version it is? I downloaded a new version in the last month.
  • edited November 2017
    The PlayerStarts in other scenes won't affect it - I'm talking about any other PlayerStarts in this same scene that aren't marked as the default in the Scene Manager.  How many in this scene do you have, and where are they placed?

    The AC version number is shown in the About window (Adventure Creator -> About at the top toolbar), and also at the bottom of the AC Game Editor window.

    The screenshots don't show where the player ought to be, but I would definitely urge you to temporarily remove all third-party scripts from the scene while this issue is being resolved.  You're also getting many script errors in your Console from another asset.  It may be that this is creating a conflict or otherwise affecting AC, so that should also be removed from the scene for the moment.
  • No other PlayerStarts.

    The player falls directly below the playerStart I chose; the only one I have. X and z axis on MainCamera and Player don't change. Only y axis drops quickly. The playerStart is definitely above land. It works fine when I'm not coming from another scene.

    I now have no compiler errors after deleting most of my scripts, but it's still not working.

    I have AC version 1.52a.

    Thanks heaps for your help. I have just solved the problem. The problem only happens when coming from a scene from asset Loading Screen Pro. I'll try figure out how to make it work with it, otherwise I'll try use your loading screen tutorial. 

    Just wanted to say thanks for developing this asset and providing support. I learned to use unity to develop an educational video game, and the game would have been shit without you. 

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.