Forum rules - please read before posting.

Player hotspot's status is Off (it goes from Default to Ignore Raycast layer)

Hi Chris! Just something else.

My player has a hotspot attached to it, so that I can trigger a non essential interaction when I click on it. I had no problem with it, but at some point after updating to 1.71.3, it is no longer interactable: the hotspot has a status of OFF. I read in the forum that it should always be on the Default layer, and I think that's what changes using the latest version of AC, since it doesn't matter that I place root and sprite objects in the Default layer, once I'm in play mode, they are assigned to the Ignore Raycast layer.
I do have some kind of version control and I was able to see it working properly on a previous version of AC. I even tried importing that version of my player to the updated project, but it is still assigned to the Ignore Raycast layer. I can do away with it, since the interaction is not mandatory for my game, but I thought you might want to see if you can reproduce it.

Comments

  • Do you have a Remember Hotspot, or some other Remember component, attached?

    The only other condition that should cause the Player's layer to change automatically is if you're using player-switching - via the Auto-sync Hotspot state? option. Is this the case?

  • I don't have any remember components in the player or its children, and I am not using player switching. I think I never saw the auto-sync hotspot state option.

  • Best to do some debugging to find out the cause, then.

    Open up Hotspot.cs, and find the line:

    gameObject.layer = LayerMask.NameToLayer (KickStarter.settingsManager.deactivatedLayer);
    

    Just below it, place:

    Debug.Log ("Turned off Hotspot " + name, this);
    

    Assuming it then shows for the Player's Hotspot, select the message and share the full contents.

  • Ok, this is what I got:

    Turned off Hotspot Player
    UnityEngine.Debug:Log(Object, Object)
    AC.Hotspot:TurnOff(Boolean) (at Assets/AdventureCreator/Scripts/Logic/Hotspot.cs:673)
    AC.Hotspot:TurnOff() (at Assets/AdventureCreator/Scripts/Logic/Hotspot.cs:661)
    AC.Player:AutoSyncHotspot() (at Assets/AdventureCreator/Scripts/Character/Player.cs:1044)
    AC.Player:OnSetPlayer(Player) (at Assets/AdventureCreator/Scripts/Character/Player.cs:1030)
    AC.EventManager:Call_OnSetPlayer(Player) (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:1044)
    AC.KickStarter:set_player(Player) (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1023)
    AC.KickStarter:PreparePlayer() (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1165)
    AC.KickStarter:Initialise() (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1104)
    AC.MultiSceneChecker:Awake() (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:44)

  • Bug found. Open up Player.cs and replace:

    if (autoSyncHotspotState)
    

    with:

    if (autoSyncHotspotState && KickStarter.settingsManager.playerSwitching == PlayerSwitching.Allow)
    
  • Fantastic, that did it! Thank 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.