-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Weird behavior on actor clone #2575
Comments
There certainly was, I'll figure out what happened there! This does seem like a bug in the cloning, I think you are right not everything must be copied correctly. It sounds like there is something off in the graphics component color change, and the collider component events at minimum. |
@robly18 Does this show up for you when you click "new issue"? |
Yeah, now it does. Don't know why it didn't yesterday, maybe I opened an issue in some weird way that automatically opened a blank issue. Thanks! |
Closes #2575 ## Changes: - Update Graphics layer cloning to clone individual graphics - Update Collider Component cloning to clone stored colliders ## TODO: * [x] Investigate ColliderComponent cloning to determine eventing issue * [x] Look into other components closely
Thanks @robly18 for reporting this! |
I've tested against your repro and I think we've got both issues sorted 👍 |
No problem! Thank you for the excellent package. As you can probably guess by my reports, I'm working on a project that uses |
Thanks for the kind words! |
(Wasn't there a template for bug reports somewhere? I couldn't find it this time around.)
Excited as I was for the clone bug fix, I continued working on a side project of mine, but ran into some weirdness. After a lot of second guessing myself, I've reached the conclusion that the current method for actor cloning has a bug in it somewhere.
This example is being run on Excalibur v0.28.0-alpha.628+017953a.
Minimal Working Example
Expected Behavior
One should see two falling physics objects,
paddle
andpaddle2
, and awall
belowpaddle
.paddle2
should be a copy ofpaddle
, but with a different x coordinate and a different color. There is acollisionstart
event assigned topaddle2
, which should never occur because it never collides withwall
.Actual Behavior
While
paddle2
does indeed have a distinct x coordinate frompaddle
, the change in color topaddle2
also applies topaddle
, which becomes red instead of chartreuse. Moreover, thecollisionstart
event is triggered whenpaddle
collides with the wall.Probable Cause
The deep copy which should be happening when
paddle.clone()
is called is probably not deep copying some of the object's components.The text was updated successfully, but these errors were encountered: