Creating a follower after using `setPosition` lags the world
See original GitHub issueHi.
I’ve currently got followers added in my game world. Followers can be added and removed with no problem.
However, when I attempt to use setPosition
before spawning a follower – everything functions well until said follower is spawned in. When the follower is spawned in, the world begins to lag uncontrollably.
Here is the bug in action:
https://www.loom.com/share/5a49744b121d44fcad0f423ae0e7baaa
I attempted to show you the bug occurring after spawning a follower and then using setPosition
, as well as using setPosition
prior to any follower spawning.
Note that my follower creation code is simply adding a character and using .follow()
. Remove is a bit more complicated than that, but the bug occurs prior to removing a follower.
This video also displays the bug occurring in #273.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
@ok1a setPosition takes an optional 3rd param being the layer. have you tried setting that?
I was thinking of handling this locally, in the meantime, by setting a subscription to follower movements and determining the delta between playerPos and followerPos. If the delta was something like +5 or +10 tiles away, I would despawn the follower.