Forum rules - please read before posting.

Is it possible to use a sprite as Hotspot 2D?

Hi again!!!
I wondered if possible use sprites instead of Hotspot 2D. This would be useful for very irregular objects in the foreground, in front of all selectable objects. The problem that I have with Hotspot 2D is that I am not able to edit them irregular shapes and are always square or rectangular.

Thanks!!



Comments

  • You can try to put the Hotspot component on the sprite's gameobject. I do that with my character sprites too, works fine.
  • Could you explain a little more extensively this trick? I'm not very experienced and I'm starting with this. Thank you!
  • edited August 2015
    What you need to do is delete the Box Collider 2D component from your hotspot and add a Polygon Collider 2D component. When you then edit the collider you can turn it into any shape you want. You can also add multiple collider components if needed.

    image

    image
  • What? your telling me i can use polygon collider 2D as hotspots? :O
  • edited August 2015
    Yep. Well, you can't substitute the actual hotspot object for just a collider, but you can attach whichever type of collider you want to the hotspot object. By default the Hotspot 2D object has a box collider attached to it, but you can replace it with a Polygon Collider :)
  • It's true!  The 2D demo game does this for the Tree.
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.