Forum rules - please read before posting.

Player Character keeps stopping at a certain direction

edited June 2023 in Technical Q&A

Hello again,

In a specific scene, my character keeps reverting back to Idle_R immediately after the walking animation ends, instead of transitioning to the expected Idle_L state. Idle_R is set as the default state in the Animator. Interestingly, when I inspect the animator, it shows that Idle_L is enabled after the walking (Left) animation ends. However, in the scene, my player character continues to display the Idle_R sprite. I have removed all the actions, but the issue persists. Can anyone provide any insights or possible explanations for this behavior? Thank you in advance!

Comments

  • I just realized that the NavCam's horizontal movement isn't functioning properly either. Additionally, after this scene, the Player Character changes to another character. However, as mentioned earlier, these issues persist even though I have disabled all the actions in the scene.

  • Your thread title mentions the Player stopping at a certain distance - can you share details on this?

    Is your Player character in the scene, overriding those in the Settings Manager, and are the issues only occuring in this scene?

    Check that this scene isn't overriding the camera's default perspective (if so, it'll say this at the top of the Manager), and check the Console for any related messages.

  • I apologize for any previous confusion. I'd like to clarify that the problem I'm experiencing isn't about the distance the Player Character has moved, but the direction. The issue involves the character's animation behavior after it stops moving.

    I'm experiencing an issue where, despite the player character moving left, the animation reverts to "Idle Right" when movement ceases. Interestingly, the Animator indicates "Idle Left". This problem persists even when all scene actions are disabled. However, when I set Player1 as the default, the character acts as expected. I'm beginning to think the "Player Switch" might be the root of this issue.

    Here's the current setup:

    • Scene B acts as the starting point for Player1, a newly introduced character.
    • Scene A contains a Door hotspot Player: Switch / New Player: Player1
    • Scene B also has a Door hotspot that links back to Scene A Player: Teleport inactive / Player: Player (default player) and Player: Switch / New Player: Player (default player)

    ▪️ When I disable all actions and play Scene B, both Player0 (default) and Player1 appear. While Player1 remains stationary, Player0 moves around but repeatedly defaults to the "Idle Right" animation after any movement. This occurs despite the Animator showing "Idle Left", and the prefab exhibiting "Idle Right" in both scene and game views.

    ▪️ If I disable all actions and play Scene A, only Player0 appears (as intended), but it faces the same animation issue.

    ▪️ When I enable the Player: Switch action at the Door hotspot in Scene A (Player: Switch / New Player: Player1), Player0 continues to display the same issue. However, upon clicking the Door hotspot that leads to Scene B, Player1 behaves correctly.

    ▪️ When I enable both the Door hotspot in Scene A (which leads to Scene B ) and the Door hotspot in Scene B (which leads to Scene A), Player0 again exhibits the issue in Scene A.

    I've also attempted to set up an additional PlayerStart2D in Scene A, hoping to spawn a player character at a different location when coming from Scene B using "Previous scene activation." Despite my efforts, it didn't work. I've tried setting a Global Variable and teleporting the Player Character to a certain position using a 2D Marker, but to no avail, even though the variables seem to be functioning correctly.

    The console doesn't show any significant messages apart from 'Spawned instance of Player 'Player0'' in Scene A and 'Spawned instance of Player 'Player1'' in Scene B.

    I'm growing concerned as my game is intended to have four different Player Characters, with one character transforming between an animal and a human.

    Thank you for taking the time to read this post, I genuinely appreciate it.

  • Don't worry - we'll sort these issues out.

    It sounds like the issue is less to do with Player-switching and more to do with Player0, since your description all feature Player0 having the issue despite the other settings. You can test this by temporarily disabling player-switching and placing Player0 in the scene.

    If the "Idle Left" animation is playing in the Animator - does this animation involve the Idle Right sprite, only flipped - either as part of the animation, or through the use of AC's Frame-flipping option?

    If the animation is correct in the Animator, it sounds like its either a case of some other Animator/script affecting the sprite, or the AnimationClip itself playing the wrong sprite.

    I've also attempted to set up an additional PlayerStart2D in Scene A, hoping to spawn a player character at a different location when coming from Scene B using "Previous scene activation." Despite my efforts, it didn't work.

    The issue here is that Player1 is already in Scene B. You're switching between two Players in separate scenes, whereas PlayerStart is only used when the same Player is transitioning from one scene to another.

    If you want to reposition Player1 in a new position when switching scene/player at the same time, you'd either need to:

    • Use the Player: Teleport inactive Action beforehand
    • Switch scene and player separately (i.e. become Player1 in Scene A, then switch to Scene B, or switch to Scene A as Player0 and then switch to Player1). The PlayerStart will then be respected automatically.
    • Create a Cutscene in Scene B that uses Object: Teleport to move the Player to the PlayerStart manually, and then attach an ActionList Starter component that responds to a Player-switch.
  • Thank you so much for your help again, Chris! You were right, my 'Idle Left' sprite was actually 'Idle Right.' It's an embarrassingly silly mistake, but without your advice, I wouldn't have thought about checking the sprite. Also, the 'Object: Teleport' now works perfectly. Thank you again for sorting everything out! I indeed have no worries tonight.

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.