Forum rules - please read before posting.

3d triggers overlapping

Hi everyone
I have multiple characters in the game that have enter and exit triggers, the on trigger enables a unity3d source based menu for an interaction menu. All characters share this menu except depending on the character the name label and character icon etc changes for them.
There's a button on the menu that starts an interaction minigame, with the current character name and anything related to that character (name, character score etc is passed to the minigame actionlist) and is set and saved when won.

The problem is if I walk into a character's trigger that activates the menu and then the minigame, and another character walks past and triggers the menu change onto them, it messes up the values during the game.

So after the minigame finishes it saves the values of the character that walked too close to the player instead.

So after all that rambling what can i do to stop this?

Comments

  • Should the Interaction menu appear while the minigame is ongoing?

    If you have a way to check if the minigame is running (if its a Menu, use "Menu: Check state", otherwise use a variable), then you could precede any Interaction menu-opening logic with this to prevent it running during this time.

  • Thats a great idea! Thank you!

  • Not sure if this is possible but is there a way to stop other characters with their triggers from walking close to the player and triggering the menu themselves? So only works if the player walks into their trigger, if that makes sense?

  • As in, the characters should avoid the Player?

    There isn't a built-in option for that, but I'm not sure how you're moving the NPCs in the first place - if you can share details/screenshots showing the situation, I'll see if I can make any suggestions.

  • Thanks - I meant that triggers should only trigger if the player walks into a characters trigger and not if the character walks to the player and causes the trigger to go off. So if the player is standing still and a character happens to walk close to the player and triggers the trigger, nothing happens. But if the player themselves walks into a characters trigger then it does work. Idk if I'm making sense lol
  • In essence, it sounds you're looking to check if the Player is currently moving at the time.

    That should be do-able with the following custom Action:

    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionCheckPlayerMove : ActionCheck
        {
    
            public override ActionCategory Category { get { return ActionCategory.Player; }}
            public override string Title { get { return "Check moving"; }}
    
            public override bool CheckCondition ()
            {
                return KickStarter.player.charState == CharState.Move;
            }
    
        }
    
    }
    
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.