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

The other player can't see the bullet #43

Open
a7210232 opened this issue Jul 16, 2021 · 8 comments · May be fixed by #62
Open

The other player can't see the bullet #43

a7210232 opened this issue Jul 16, 2021 · 8 comments · May be fixed by #62
Assignees
Labels
bug Something isn't working

Comments

@a7210232
Copy link

why The other player can't see the bullet self can

@tabakd
Copy link

tabakd commented Mar 9, 2022

Hi! I'm also running into this issue. I'd like to try to fix it. Any ideas what may be causing this? @halftheopposite @LukeWood
Great boilerplate btw!!

@LukeWood
Copy link
Contributor

LukeWood commented Mar 9, 2022

Really not sure honestly. maybe a colyseus API changed with a major version?

@tabakd
Copy link

tabakd commented Mar 9, 2022 via email

@halftheopposite
Copy link
Owner

@tabakd That'd be great if you can fix it and submit a PR 👍

@wheresthebeefy
Copy link

@tabakd Could you post a quick fix here in the meantime? I'm able to get it working if I comment out the bullet recycling code on the server-side so it only pushes new bullets, and also if I just push the recycled bullet onto the existing bullets array. But if I delete the bullet from the array and re-push, no go. My guess is Colyseus isn't detecting the array change because it thinks it is the same item, and could probably fix it by adding a new ID like this monsters array does for new entries

@Yacine-YA
Copy link

So ?

@tabakd
Copy link

tabakd commented Mar 21, 2022

@tabakd Could you post a quick fix here in the meantime? I'm able to get it working if I comment out the bullet recycling code on the server-side so it only pushes new bullets, and also if I just push the recycled bullet onto the existing bullets array. But if I delete the bullet from the array and re-push, no go. My guess is Colyseus isn't detecting the array change because it thinks it is the same item, and could probably fix it by adding a new ID like this monsters array does for new entries

That sounds like a plausible fix. I simply disabled the bullet re-use logic for my purposes but can look into fixing it.

@colus001
Copy link

colus001 commented Jan 4, 2023

It is actually happening since Bullet.reset can trigger neither onAdd, onRemove nor onChange event from Colyseus server. I don't know why Bullet instance has to be remain inactive without destroying them. But #62 fixes it without too much hassle.

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

Successfully merging a pull request may close this issue.

7 participants