Hi! I'm working on a 2D game with a scene where, if the user clicks on a specific hotspot, the Player Character teleports to the top of a chair, which is above the Navmesh.
What I want is for the Player Character to teleport back down to the floor whenever the user clicks on any other hotspot, allowing the Player Character to walk normally afterward. The reason I need this setup is that, right now, if I click any hotspot after the Player Character is on the chair, they just walk down to the hotspot, which looks odd since the chair is higher above the ground.
The issue I’m facing is that all my hotspots have “walk-to” options.
My question is:
Is there a way to set it up like this?
Run Interaction A -> and then, Walk-to the hotspot -> Run Interaction B
Any advice on achiving this would be greatly appreciated. Thank you.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Sorry, I'm not quite clear on your meaning here.
You can prevent the Player from moving while on the chair with the Player: Constrain Action, but if you want them to teleport off the chair when another Hotspot is clicked you may need a bit of custom scripting.
What's the exact behaviour you want to achieve if another Hotspot is clicked while they're on the chair?
Thank you for the quick response!
Sorry my question was unclear. Here’s what’s happening now: https://drive.google.com/file/d/1l3Jo2v6nU1edq2P1tSW2L3S0LKXapSao/view?usp=share_link
The Player Character is currently walking down from the chair to the hotspot.
What I want to achieve is to have the Player Character first teleport to a Marker2D on the floor (where the Navmesh is), then start walking to the hotspot and continue with the rest of the ActionList. I imagine there are several ways to set this up, so I was wondering if there’s a correct or efficient way to make this happen.
(I tried using multiple Interactions—one that teleports the Player Character to the floor level and a Hotspot set to "Player action: Do nothing." However, these approaches didn’t work as expected. Right now, I’ve covered the screen with a large Hotspot using a Polygon Collider 2D set with a single Action - Object: Teleport- to teleport the Player Character back to the floor, but this makes the interaction feel inconsistent. Sometimes, players feel they need to click the hotspot twice to make the character walk toward it.)
And I've now learned that this may require custom scripting. Although I don't have a coding background, I'd be grateful for any guidance or tips on using references - I'll do my best to figure it out. Thanks for reading, and thanks again for your help.
Thanks for the details.
You can attach AC's Event Runner component to any such Hotspot, and define a Hotspot / Interact event that specifically runs for that Hotspot. Assign an ActionList, which contains an Object: Teleport Action that moves the Player to the Marker. This will kick in before the Player begins moving.
Thank you so much for your help! This is exactly what I needed. I didn’t know about this component, and I can already think of many other situations where I can apply it!