Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player walk animation not played when moving while thread is running #1645

Open
Rebusmind opened this issue Nov 13, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Rebusmind
Copy link
Contributor

Describe the bug
When the player is moved via an actor move event while also a thread is moving another actor, the movement animation is not played.

To Reproduce
See this script:
grafik
When I disable the thread, the player walks normally.

Expected behavior
The walking animation should be played even if a thread is running.

Screenshots
With the thread running in parallel:
With Thread

Without thread:
Without Thread

Platform (please complete the following information):

  • OS: Windows 11
  • App version 4.1.3

Additional context
This only seems to affect the player, other actors can walk at the samt time with no issue.

@Rebusmind Rebusmind added the bug Something isn't working label Nov 13, 2024
@chrismaltby
Copy link
Owner

Hi @Rebusmind just spent a little time investigating this, I believe it's caused by the exact same issue as #1644 that you raised earlier. As soon as you start a thread it's causing the script to become unlocked, which is currently needed to allow multiple threads to run at once but has the side effect of causing topdown_update() to run at the same time too. topdown_update() is responsible for moving the player when your press input (what you saw in 1644) and also for stopping the player animation when no input is pressed (the issue you're seeing here)

To me it seems like there needs to be a way for switching between

  • Only one script runs at once
  • Multiple scripts can run but the game update function doesn't run (<-- this isn't possible now)
  • Multiple scripts and game update function can run simultaneously

Or something that ends up with a similar result. I'll need to have a think how best to achieve this and how to not break any existing projects in the process.

@Rebusmind
Copy link
Contributor Author

That makes sense.
Maybe threads could have a checkbox for this titled "Disable player input"? Might be too abstract, though. And it would have to work with every scene type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants