local id = factory.create('#factory', position)
local sprite_url = msg.url(nil, id, 'sprite')
msg.post(sprite_url, 'play_animation', { id = hash('anim') })
go.delete()
Example without crash:
local id = factory.create('#factory', position)
local sprite_url = msg.url(nil, id, 'sprite')
msg.post(sprite_url, 'play_animation', { id = hash('anim') })
-- go.delete()
Here is a give quick overview of my setup, please point out any difference:
main.collection
main.go
main.script
factory: /tmp.go
tmp.go
sprite, animation: test1 using tmp.atlas (has images; [test1, test2] )
main.script
local position = vmath.vector3(100, 100, 0)
local id = factory.create('#factory', position)
local sprite_url = msg.url(nil, id, 'sprite')
msg.post(sprite_url, 'play_animation', { id = hash('test2') })
go.delete()
This results in the sprite changing image (/animation) to test2 and the main.go being deleted.
The animation (test2) must ends after deleting go. I think, in your case image can change before deleting. In my case animation has duration at least 1-2 seconds.
I’m going through old issues in our system and I’m not able to get this to crash using the most recent editor and engine. I’m closing this until someone else reports that it’s still a problem.