Forum rules - please read before posting.

What would cause the player facing direction to get locked?

edited March 6 in Technical Q&A

I am using Unity 2019.4.6f1 and AC 1.72.4

Movement Method: Direct
Input Method: Keyboard of Controller
Input magnitude affect speed?: yes
Turn instantly when under player control?: yes

The player's motion control: Automatic.

The observation is that, make the player walks in a direction and then press the opposite direction without letting go of the first one, the player facing direction get locked.

No matter which direction I move, the player is still facing the same direction.

I checked with Debug.Log(KickStarter.player.GetSpriteDirectionInt());, the value is always the same.

Even if I use the face direction action in an actionlist, it wouldn't change.

But if I use KickStarter.player.SetSpriteDirection(CharDirection.Left);, the facing direction could be changed. But then it will stay at the set direction, and will not change again according to the player movement.

There no error log at all.

May I ask does Adventure Creator has any mechanism to lock or free the player's facing direction?
Otherwise, what would cause Adventure Creator to not detect the player's facing direction according to the directional input?

Thank you for your help.

Comments

  • Calling SetSpriteDirection will lock the direction - you can set the lockDirection function to false to release this lock.

    Create a new project, import the latest AC, and copy over your game's character and Manager assets. Does the issue still occur?

  • By setting lockDirection function to false solved the problem.

    Thank you for your help.

    The weird thing is that the player were suddenly locked when the game state is Normal and just walking back and forth. May there is something else I didn't observe.

    The only thing happened was the hotspot icon being triggered. But in the script of hotspot firing up, the only ones that is related to AC are:
    KickStarter.playerInteraction.GetActiveHotspot();
    KickStarter.playerInteraction.GetActiveHotspot().GetIconPosition();
    KickStarter.playerInteraction.GetActiveHotspot().GetFullLabel();

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.