Forum rules - please read before posting.

Two player start

Hi,
here the problem
i have a scene 1 with two doors. Player can come back in this scene through this two doors with its start markers. I created variable door_ind . If you come through door1 door_ind=0 else door_ind=1.

here actions OnStart: 
image

NavMeshes switched normally, but not a player start marker. It always default

Comments

  • In scene settings playerstart changed to playerstart_up, but player stand on playerstart position 

    image
  • edited December 2015
    This should be in your OnLoad not in your Onstart.
    Since you move from scene to scene and OnLoad is called there. Make sure you defined correctly your OnLoad and OnStart  CustScenes that needs to be run in AC Scene tab in Scene Custscenes sections.

    OnStart is only called once when you start your game, either from the editor or when you launch your game without Unity. Unless you call your Onstart from some actionlist.

    Can you create a marker and send or teleport (Object:teleport action) your player there when your variable checks not zero or one?
    Make sure you add PlayerStart (script) component to that marker.
     
  • Thanx, Object:teleport helped. 
    Actions worked in Onstart. In OnLoad navmeshes is not switch
  • edited December 2015
    Changing the PlayerStart when the scene begins will change the field, but only after the Player has entered the scene.  As @SkyTree suggests, you should indeed teleport the Player instead.

    However, I think there might be some confusion so far as OnStart/OnLoad goes.

    OnStart is called whenever you enter a scene through normal gameplay.  i.e. when you begin a game from this scene, or when you enter it using the Engine: Change scene Action.  It is used to create "intro" Cutscenes like a player walking through a door to enter the room.

    OnLoad is called whenever the scene is loaded via a save game file.

    When it comes to positioning the player based on their previous scene, just create a new PlayerStart for each, and edit the settings in that PlayerStart's Inspector: from there, you can choose what previous scene it is used for.  So long as the two PlayerStarts are used for different previous scenes, you don't need to use Actions to change them / teleport the player when the scene begins.
  • "...just create a new PlayerStart for each, and edit the settings in that PlayerStart's Inspector..."

    bouth PlayerStart's have same previous scene.
  • edited December 2015
    i use OnStart, because if i teleporting player OnLoad, player will not remember its last position (when loading saved game)
  • I'm sorry, Chris is right about how OnStart and OnLoad work.
     
     I completely got you confused with my set-ups.
     It's just I have so many things there like hint system, cowntdowns, music and sounds that should play in specific levels and turn off in another ones, running with different Onload and Onstart, that it can get me confused a bit some times.
  • Was there any resolution to this? I also have 2 player starts coming from the same previous scene. It always starts me off on the wrong player start.

  • @andrewgbliss Create a Global Variable in your Variables Manager and use it to state which of the two entry points the player is coming into the scene via. This should be done in the previous scene, before switching.

    This could be e.g. a PopUp variable, with values such as "Left Door" and "Right Door". Just before you switch scene, use the Variable: Switch Action to set it to the appropriate value.

    Then in your new scene's OnStart ActionList, use the Variable: Check Action (or optionally Variable: PopUp switch if you did use a PopUp variable) to work out this variable's value, and follow it up with an Object: Teleport Action to place the Player at the desired Marker / PlayerStart.

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.
Do NOT follow this link or you will be banned from the site!