Not sure if this is a bug or intended behaviour, but when calling sprite.play_flipbook or equivalent msg.post on a sprite in a different collection proxy I get ERROR:GAMESYS: Could not send animation_done to instance: /someinstance#somescript
I’m guessing it’s because the instance doesn’t exist in the “world” of the collection that has the sprite, and the animation_done message doesn’t have the socket component of the url.
Yes, I believe you are right. You can for instance not use the go.* functions on a game object in another collection proxy. But we are apparently not handling this in a good way for sprite.play_flipbook(). Please open a ticket on GitHub for this!
If I had to hazard a guess it’s because the play_flipbook is just shorthand for a msg call while go.* calls directly affect the properties (emphasis on guess, didn’t really look into defold source code to figure out why things happen like they do). I’m guessing the go.* has a good reason (e.g. physics being directly affected by something from outside of the physics world?).
I’ll open a ticket shortly.
On a follow-up note, what is the best way to do things like change position or animation in a different collection proxy?
Almost. sprite.play_flipbook() is a shorthand for msg.post() of a “play_animation” message to a sprite component.
Thank you
Perhaps post a message to some script in the collection and ask it to play the animation or change position? Or can all of it be handled inside the correct collection proxy in the first place?