Forum rules - please read before posting.

2D images with hostspots

Hi there,

I was just wondering if this is possible, I've tried adding 2D box collider and hotspot components to the image and that didn't work. My game is 3D but would like the option to have hotspots on 2D images or at least some way of making the cursor change to interaction:use cursor when I hover over the images. Thanks

Comments

  • If your game is in 3D, then you must rely on 3D colliders.  You can still make use of sprites and images, but the collider must have depth.  Try adding a Box Collider instead.
  • Thanks for the response, is there any way for sprites and images to act as usable objects so that when I hover over them the cursor would change the same way as it does when I hover over the Hotspot? Would like to avoid adding Box Collider, it won't cover the surface of the image from all angles.
  • I think you'll need to provide some screenshots - as the point of a Box Collider over a 2D equivalent is that it does cover all angles.  If viewed from the side, for example, its depth allows it to still be clicked.  Don't forget you can reshape the Box to become very thin if need be.

    By "change the same way", are you referring to the Hotspot brightening effect due to the Highlight component?

    That effect works by affecting the "_Color" property of whatever shader is on the Renderer its attached to.  This limits its automatic usage to shaders that feature this - but should work with the Sprites-Default shader as well.  If need be, you can hook into the Highlight component's custom events feature to trigger your own "hover" effect.
  • edited September 2018
    I can confirm I'm using thin 3D box colliders for billboard sprites in 3D, 2d box colliders obviously won't work in 3D space, so just make it thin. There's also mesh collider if you need alpha areas to not react to raycasts (also 3D not 2d). Also, if your hotspot component isn't on the sprite object, make the hotspot object a child of the object instead of separate if you need it to stay in the same position (although I'm never sure if this is good practice or not).
  • Hey guys, thanks for the responses. So by "change the same way" I was thinking on the option for Cursor to change from normal cursor to, in my case, animated cursor when you hover over the hotspot. I was thinking about calling that function on hover (over my 2D sprites) so that I don't have to worry about making hotspots on my 2D sprites because that's the only thing that I need. Gosh I feel like I'm making no sense... I'm sorry for that in advance, I'm doing my best to explain the exact thing that I need...
  • Then please, screenshots will help here.

    If all you're looking to do is have your cursor change over them in the same way as it does when over regular 3D Hotspots, then adding a 3D Collider really should be all you need.
  • edited September 2018
    So I've added 3D box colliders to my sprites, it's not registering hotspots on the them, not sure what is it that I'm doing wrong. I'm attaching some screenshots. Hotspot detection method is set to Mouse Over.

    https://imgur.com/a/85s4xNn


  • What's its size and position relative to "regular 3D" Hotspots Hotspots in the scene?  That your Box Collider's Size is 100 makes me wonder if its so far away from the camera that it's exceeding the "Hotspot ray length" value in the Settings Manager?

    Please show more screenshot - the more, the better - of your scene setup and Settings Manager.
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.