Forum rules - please read before posting.

How to interact by key?

I want the label of the hotspots appears and be able to interact with (by key) when player comes nearby.

I've set the movement method to Direct and also switched to Player vicinity in detection method.

But I am not sure what to next, Thank you.

AC is awesome btw!

Comments

  • I also added a DetectHotspots to the player.

  • Welcome to the community, @sean60.

    AC separates Hotspot detection, input, and movement modes so that all can be set independently.

    To interact with Hotspots with a keyboard or gamepad, define an input named "InteractionA" in Unity's Input Manager and map it to your intended key.

    To have your game be controlled purely with these inputs (i.e. no mouse) set your game's "Input method" to "Keyboard Or Controller". More details on this can be found in the Manual's "Keyboard or controller input" chapter.

    You can get a list of all definable inputs that AC will respond to (given your current settings) further down the Settings Manager.

  • Hello ChrisIceBox.

    I successfully set up something so when I move the player near the hotspot, the label comes up and I am able to interact(by pressing InteractionA). However I have new issues now.

    1. When the player walk away from hotspot, the label won't disappear and the interaction would still shows up when I press the InteractionA key.

    2.I added a rigidbody2d and box collider(IsTrigger unchecked) to player and a box collider to the object but player can walk pass through it. Box colliders can't block player's movement.

    What should I do? Thanks.

  • When the player walk away from hotspot, the label won't disappear and the interaction would still shows up when I press the InteractionA key.

    I will need to see your Settings Manager and the way your Hotspot Detector is set up. Full-screen screenshots of your Player + Hotspot Detector child will be best.

    What are your AC and Unity versions, also?

    I added a rigidbody2d and box collider(IsTrigger unchecked) to player and a box collider to the object but player can walk pass through it. Box colliders can't block player's movement.

    Do you mean a Box Collider, or Box Collider 2D? You will need to rely on 2D collider components if your Rigidbody is 2D - it can't react to 3D colliders. Make sure also that it's not Kinematic. Any screenshots of your Player Inspector and scene that you can share will help me understand the situation.

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.