Forum rules - please read before posting.

I need help on 2D hotspots after following the tutorial.

edited June 2014 in Technical Q&A
So currently I have a 2d scene with a sorting layer, player start, a few animated sprites in the scene, got my NavMesh2d correctly done, also have my collision cubes sorted out (I am using the direct control method.) Everything works great in the scene, I can move around with the arrow keys and what not. Problem comes when I try to set up a hotspot. I followed the tutorial for making a door open, even though that's in 3d I figured it would still work.

I created my HotSpot from the editor, I reshaped it and placed it over the sprite, paying careful attention of its z-axis shape as well. I added the highlight script to my object. On the hotspot itself, I assigned the object to highlight. I created a marker, placed it in front of the hotspot. I assigned the marker with the walk to. I made the interaction as in the tutorial, the transform, and auto created it. Assigned the moveable script to the correct object.

Problem is, in game, when I mouse over the hotspot, nothing happens at all. If I click, nothing happens. It's like it's not detecting the hotspot and I'm not sure what I'm missing.

Any help would be appreciated.

Comments

  • Anyone? Tried 2dHotspots in another scene, still the hotspots don't seem to do anything. I looked at the 2d demo scene and I can't find any difference between that setup with hotspots and mine. Is there something I'm missing, maybe something in the managers? Is there anything involved with hotspots other than creating the hotspots, having a hotspot interaction? Can someone walk me through a bit better please?

    I'm assuming there's got to be something I'm missing.
  • Which 2D mode are you using, and what kind of camera is active (prefab and orthographic/perspective state)?  When using Unity 2D mode, the Scene Manager should give you the option to create "Hotspot2D" prefabs rather than the regular ones.  Screens of your scene and Settings Manager will help.
  • Unity 2D sir.

    The GameCamera2D should be active, i believe. I used the Hotspot2D from the scene manager. I have included 6 pictures to show you my settings, as requested.

    I have tried multiple different things, and I just can't get the hotspots to detect in game, and I just don't know what the problem is. Also, as a side issue, I've noticed that the camera seems to have some sort of momentum to it, where I swear it didn't use to before. It'll follow the player character around, but when he stops, it doesn't immediately halt, it kind of slides slowly into place, like it's coming to rest. It wouldn't be a problem, except for the fact that this motion seems to cause the pixel art to redraw on the monitor a bunch of times, almost like when vsync is disabled on a game or something. It's an annoying effect. Any idea what this is? I'm a new user to Unity, I've only been learning it for about 4 days.

    http://imgur.com/zO6nSPe
    http://imgur.com/TzP3gLK
    http://imgur.com/xtH6RZa
    http://imgur.com/rrWCLa9
    http://imgur.com/vldoHv8
    http://imgur.com/syW5Dmo


  • Also on the player prefab which I set up according to the tutorial, it has:

    Transform, Circle Collider 2D, Rigidbody 2D, Player Script, Paths Script, Audio Source, Follow Sorting Map Script

    And it seems to work fine. One odd problem though is hitting Trigger2Ds that start a conversation, the character continues walking and I can't stop him.
  • The Hotspot is not active, because you've placed it on the Ignore Raycast layer.  At the top of the Inspector, right-click on Layer and choose Revert Value to Prefab.

    You can reduce the smoothness with which the camera follows the player by increasing the Follow speed in the GameCamera2D's Inspector.

    And for the Trigger problem, see if checking Cancel interactions? in the Trigger Inspector helps.  If not, you can force the player to stop by using the Character: Move along path Action and checking Stop moving?.
  • edited June 2014
    I know I'd tried it on the default layer before as well, but doing as you said, I reverted it to prefab. I also tried making another one. It still doesn't work. I just can't figure out why. I'm on the version right before your latest release, perhaps I should upgrade to the latest and see if that changes anything?

    As for the trigger problem, adding Character: Move along path and stop moving fixed it, thanks so much! Cancel interactions just wasn't doing it.

    And thanks for the camera speed tip as well, fixes the issue.

    I really appreciate this tool you created and the help you give on the forums on a daily basis. So much to learn. It's invaluable.
  • Thank you, it's appreciated.

    The Hotspot should register so long as it's on the Default layer, and nothing else is in front of it.  Perhaps it's conflicting with the background sprites.  Have you placed them on the Ignore Raycast layer?
  • I double checked everything that was behind it, and it's all on the Ignore Raycast layer. I just don't know. Any other ideas?

    I was having a problem with speech showing in subtitles as well, it would only ever show the first letter of a line and then go away, but I found out that the problem was something to do with text scroll, so I disabled it and the text displays properly.
  • edited June 2014
    PM me your project (scaled down to just the minimum-needed assets to demonstrate this) if you can.  It's really not clear what's causing this problem.
  • Hello! New user here, loving the tool thus far! I'm experimenting with a similar kind of setup as the one described above, with a 2D player character using direct keyboard/gamepad control and proximity-based hotspots.

    I've modified the finished 2D tutorial scene so the character navigates properly with the arrow keys/WASD, and hotspot labels appear when the player nears them, but I can't seem to figure out how to interact with them. They were set up to work with the point-and-click system, but the switch to direct control seems to have removed their functionality beyond the label appearing when in proximity to it.

    After a search, this seems to be the closest discussion to the topic, so I'm wondering if this was ever resolved, or if I'm simply forgetting some basic setting to make hotspots active with direct control.

    Thanks again for creating this wonderful tool -- I know I'm going to enjoy using it!
  • (update) After doing a bit more experimentation I realized I needed to add the new "InteractionA" input to the input manager to interact with hotspots in Direct Control mode. I'd assumed before that the normal "Input" key (default to Enter/Return) would suffice.
  • Anyone know how to reshape the "2d Hotspot box" please?
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.