Forum rules - please read before posting.

Layer Names -> Deactivated -> Ignore Raycast ( Plus additional's )

edited October 2014 in Engine development
Hello,

how would I include more than 1 Layer in the Deactivated layers, do I do something like: Ignore Raycast, AnotherOne,

Coma ","  or ?

is it even possible?

Thanks 

Comments

  • No, it's not.  So as I can get an understanding of how this might be useful, for what purpose are you trying to do this?
  • The purpose is related to this thread; http://www.adventurecreator.org/forum/discussion/comment/3245#Comment_3245

    Basically I'd want to have a 3rd Party GUi system for example under layer newGUI, and newGUI will do its own menu and all that fun stuff, but if I could set the AC system to ignore newGUI that way when a player touches/clicks on the menu itself nothing will happen as AC won't register it, 

    if that makes any sense... (instead of building an AC menu that will act like a "block" just as you answered on the other post mentioned above ^)

    thanks 
  • I'm not sure layers is the right way to go about that.  Firstly, AC's menus are built using OnGUI, so the initial check to see if the cursor is over a menu is done purely by rectangles.  Secondly, checks for Hotspots are made by what's on the Hotspot layer - as opposed to what's *not* on the Deactivated layer.

    If your 3rd-party GUI relies on a physical GameObject for display, it may be better to place it on the same layer as your Hotspots - "Default" by default - rather than a new layer.
  • Okay,

    so the hotspot layer I changed from Default to "UI" as that is the layer my UI is in, so what do I have to do now in order to avoid player moving towards the "button" when clicked upon, the UI buttons have box colliders,

    I think this is where you were going with the hotspot I just am not sure how to reach that effect fully yet.

    Thanks 
  • May have been wrong about the layer change - I think you'd have to inject some custom code, instead.  Unless you use the "invisible menus" trick, you'd have to "catch" the menu click before it reaches AC's Interaction or Movement scripts.  Are you able to insert a line of code in your 3rd-party asset that runs every time an element on it is clicked?

    Assuming that the menu receives the click first, you'd have to reset the mouse state so that it can't be used anywhere else for that frame:

    GameObject.FindWithTag (Tags.gameEngine).GetComponent ().ResetClick ();
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.