Forum rules - please read before posting.

Question about the player character facing the hotspot

Hey Chris,
My game is a 2D side-scrolling experience where the player can only move left or right, with no mouse support. Is it possible to make the character face the hotspot when interacting with it? Ideally, I’d like to use a specific sprite for interactions, similar to this one https://prnt.sc/LxjRafHpiPhO

Comments

  • edited March 18

    You can use Character: Animate to change the character's animation when interacting with a hotspot.

  • I used Character: Animate to change the character's animation and it worked. However, this approach requires setting it up for every hotspot individually. Is there a simpler solution?

  • edited March 18

    In the Hotspot Interaction's properties, you can set the Player action field to Turn To Face to have the Player face the Hotspt.

    Alternatively, use the Events Editor, available in the top toolbar, to create a "Hotspot: Interact" event.

    This will run each time a Hotspot is interacted with - you can use it to run a Character: Face direction Action.

  • In the Hotspot Interaction's properties, you can set the Player action field to Turn To Face to have the Player face the Hotspt.

    • This was the first thing I tried, but it didn’t work because my game is restricted to Left and Right movement only. However, after adding the facing front animation to the Talk setting in the player’s configuration, it worked—but with a minor issue. The character keeps flickering between dialogue lines, switching from the facing front animation to the idle animation repeatedly everytime the dialogue changes. https://prnt.sc/bVoPiecValMX
  • I think this is because in-between lines the character isn't technically talking for those seconds so it reverts back to your idle animations but because you only have idle animations for left and right, that's all it can refer to using. If you were to make a front facing idle animation (even if it's just one frame facing forward) and put that in your animation controller, when the game flicks to idle between lines it won't make them face left or right anymore.
  • Thank you for the advice! Here’s what I did:

    It seems to work when I set the hotspot to "Face front," but I'm encountering two issues:

    • When the scene starts, the game plays the front-facing animation instead of the idle animation.
    • After interacting with the hotspot and finishing the dialogue, the animation doesn't revert to the idle state.

    Any suggestions on how to fix these?

  • When the scene starts, the game plays the front-facing animation instead of the idle animation.

    The Player's starting direction is based on the PlayerStart that they are positioned at. When starting the game from a given scene, this will be the "Default PlayerStart" assigned in the Scene Manager.

    After interacting with the hotspot and finishing the dialogue, the animation doesn't revert to the idle state.

    What animation exactly is being played in the Animator Controller? If they were set to face upward, they'll continue to do so until told to face left/right - which can be done with a Character: Face direction Action at the end of your Interaction.

  • Thank you, Chris. I can confirm that the issues is resolved.

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.