Does anybody know how to change the raycast mask on Scene Objects for a layer that is not Default? I'm trying to change the mouse cursor when hovering over Scene Objects, but (for technical reasons specific to my project) they cannot be assigned to the Default layer. When I assign them to any other layer, the cursor doesn't change.

I thought the cursor raycast could have used the same layer mask as the one specified in Game Controls/Interaction Settings for click interaction, but it seems not.

Or did I miss something obvious?
  • edited July 17
    I think this is based on the HUD Layer Mask setting in Menus > Menu Settings > HUD Settings.
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks GiL! You really thought of it all... ;)
  • Sometimes it's a bit too complicated and spread out :)
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hmm I'm still having problems with this. I have my ground set to a ground layer so the players mouse clicks will ignore objects blocking the camera. However my mouse cursor doesn't switch to my walking cursor. Even with the ground layer selected in HUD layer masks
    Warborn
  • edited July 19
    @Wrofir : I have some similar issues with mouse cursor changes and interaction clicks...

    I think I found the general issue. When you click on an object with an interaction event on it, if you click again elsewhere on the screen but not on any layer that is in the layer mask of the interaction settings, then ORK seems to detect it as a click on the event interaction object.

    I was able to "solve" the issue by providing a background object on a layer that is included in the layer mask of the interaction settings. It seems like the raycast doesn't reset itself when it hits nothing.

    As I said, I also had similar issues with cursor changes for scene objects. Let's says you have 2 objects. When you hover over object 1, the cursor should change from cursor 0 (default) to cursor 1. When you hover over object 2, the cursor should change to cursor 2. So, you assign a scene object component of 2 different types (with different cursor) to each object. Now, let's say, you start the game in mode A, in which your cursor should not change when you hover over object 1, but only change when you hover over object 2. To achieve this, you assign a variable condition on each scene object in the inspector. Object 1 should change the cursor only when Mode = B and Object 2 should change the cursor only when Mode = A.

    Now, let's say that when you click on Object 2, it changes the Mode to B and when you click on Object 1, it changes the Mode to A.

    Normally, as soon as you click on Object 2, the cursor should revert to default right? Well, no. If your "background" is of a layer that is not included in the layer masks of HUD Settings, then it will stay as Object 2 cursor until you move it over another object (that is on a layer mask included in the HUD Settings).

    At least, that's what my recent experiments led me to think... I hope it can be of some help to GiL!
    Post edited by ArsMagika on
  • I will investigate.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.