Forum rules - please read before posting.

Polygon Collider 2D as hotspot - not working

I'm just starting out with AC. I ran through the 2D primer video and recreated the example game with no issues. I've now started on my own game, with the intention of kicking off by running through that video again but with my own assets, and then expanding out from there.
However, I've got to the 'add polygon collider 2D component to tree' part and am having issues. I've added that component to my tree-equivalent (a rocket), and created a couple of use interactions, but in game mode it doesn't seem to recognise it as a hotspot - no label comes up, no verb options, nothing. The hotspot object I created for my bench-equivalent worked fine.
In my first run-through of the video, the polygon collider 2D worked fine with the tree, and comparing with that project now, I can't see any differences between the two set-ups. So I'm really confused as to what the issue could be! They're both using the same Unity version. There's not much about this in the manual, it's mostly dealing with nav-mesh stuff.
I also tried creating a test hotspot object and removing its box collider and adding a poly collider instead and that didn't work either, so perhaps I have some general setting that is causing issues with poly colliders...
Are there any classic noob errors I might be making here, any basic troubleshooting I could do? Screenshot below.
Thanks!

https://i.imgur.com/caNfMOR.png

Comments

  • Welcome to the community, @StinkyLomax. What are your AC and Unity versions?

    You mention "removing its box collider" - are you referring to the Box Collider specifically, or the 2D equivalent, Box Collider 2D?

    If the game isn't responding to a Polygon Collider, double-check that both the Hotspot GameObject is placed on the "Default" layer, and that your game's "Camera perspective" (set in the Settings Manager) is set to 2D.

  • Hi Chris, thank you for the reply and the welcome!
    Unity version is 2022.3.0f1, AC version is 1.77.4
    The camera perspective is in 2D as far as I can tell - the 2D view is toggled on in the Scene window as you can see in my screenshot above, and I also have now gone to Edit>Project Settings>Editor menu and checked the Default Behavior Mode was set to 2D, which it was already.
    When I mentioned "removing the box collider", I was referring to a test I did just to see if I could figure out the issue. I created a hotspot using the AC Game Editor window's Logic section, and added a Use component. It worked as expected (I get the hover label and the dialogue plays). So I then removed its Box Collider component (which is added automatically when it's created - it doesn't have 2D in its name) and added a 'polygon collider 2D' component. (I saw something like this mentioned in one of your text tutorials and thought it might be a useful experiment!) It then stopped working, so I abandoned the test and deleted that hotspot.
    So, putting that test aside and to be clear, I'm running through your 2D primer video a second time in a new project, and this time the 'bench' hotspot works but the 'tree' hotspot doesn't. The only difference in the two projects that I can see is that I've called the tree a rocket and used my own png asset for it.

  • If the Hotspot has a "Box Collider" component by default - as opposed to a "Box Collider 2D" - then it sounds like AC is set to run in 3D.

    Be aware that this is not the same as the "2D view" option in the Scene window - it's a separate option in AC's Settings Manager. Under the "Camera settings" section, look for the Camera perspective field. This is where AC's 2D/3D toggling is set.

    If it's set to 3D, change it to 2D, and newly-created Hotspots should then spawn with a "Box Collider 2D" component - and your Polygon Colliders should also work.

    I'm not sure why this setting would have changed for you mid-editing, but check that your own game's Managers are still assigned - which you can do by looking at the "Asset file" names at the top of each tab. If they've reverted back to the Demo variants (e.g. "Demo_SettingsManager") after e.g. updating AC, you'll need to re-assign your own Managers to restore your settings.

    Details on this can be found in the Manual's "Updating Adventure Creator" chapter.

  • Ahh, in the AC Game Editor window under the Settings tab, I see. Yes, you're right, Camera Perspective had somehow got set to 3D. I changed it back and now everything works. I checked my managers afterwards and they were assigned correctly.
    I don't know how that happened either - maybe a rogue click, or I accidentally set it as 3D in the start wizard and somehow made it to this point without that causing an issue?
    Thank you very much for troubleshooting that with me!

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.