Forum rules - please read before posting.

Disabling hotspot of inactive player characters at runtime after teleporting them to a scene

Hi, Chris!

I'm working on the ending scene of a game with multiple player characters. At the start of the ending scene, everyone who survives (via in-game logic) teleports to the final scene and can be clicked on to say a final quip, but after a certain point, I want to disable their hotspots entirely. I'm not seeing a way to reference the player character hotspots easily-- since whether they survive at all is pretty variable. The active player at this point is an invisible omniscient narrator.

I should be able to create a custom action to do this, but want to see if an established best practice first.

Let me know-- thanks!

Comments

  • Not in the way that character-specific Actions have a Player dropdown field, no.

    Through scripting, however, the GetAllPlayerInstances function will return an array of all Players currently in the scene:

    var players = KickStarter.settingsManager.GetAllPlayerInstances ();
    foreach (var player in players)
    {
        player.GetComponentInChildren<Hotspot> ().TurnOff ();
    }
    
  • Thanks, Chris! Figured I'd need something like this but wanted to make sure I wasn't missing something obvious.

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.