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

Update BoidsMovement.json #1286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

planktonfun
Copy link
Contributor

Issue reference: https://forum.gdevelop.io/t/boids-extension-doesnt-work-anymore-after-deactivate-it/57526/3

Update 0.2.3:

  • fix activate/deactivate behavior not working.

Update 0.2.3:
- fix activate/deactivate behavior not working.
@planktonfun planktonfun requested a review from a team as a code owner May 13, 2024 03:16
@Kruger77
Copy link

Thanks for the fix 🙏

Copy link
Contributor

@D8H D8H left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting an update.

Comment on lines -746 to +756
"runtimeScene.__boidsExtension.boidsManager.remove(behavior);"
"behavior.activated = 0;"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing this line, deactivated Boids will stays in the R-Tree and will continue to have side effect on other Boids.
A behavior already have a activated() accessor, but it's not needed. What should probably be done is to remove the Boids from boids.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the error, by removing the boid from the R-tree it forgets its original behavior when reactivated, so my solution is to pause and then resume it when needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants