Use play_flipbook with tilesource animation

Good afternoon, sorry for the stupid question, but does the play_flipbook() function work with tilesource animation?

When I use in play_flipbook("#sprite", “[atlas animation]”) it works fine but refuses to find the path no matter if I put in animation name or 100% path

Note: destruct is the name of the animation in the tilesource

function on_message(self, message_id, message, sender)
	if message_id == hash("trigger_response") and message.enter then 
		sprite.play_flipbook("#sprite", "destruction", function()
			go.delete()
		end)
	end
end

Typo in the post here on the forum or an actual mismatch?

Yes, it should work.

It was a bug on the forum, but just in case I checked the code, there really was a bug, but even after fixing it, nothing works.

It’s a pity that the animation works with the atlas, but not with the tileset

Unable to play animation 'destruct' from texture '/_generated_7440dd2.texturec' since it could not be found.

As @britzl mentioned, you mention both “destruct” and “destruction”. Which is it?
What is the animation called in the tileset?

“destruct”, here is my mistake on the forum.

image

image

ERROR:GAMESYS: Unable to play animation 'destruct' from texture '/_generated_7440dd2.texturec' since it could not be found.

image

But you got it working now or? If not, please double check that you have indeed assigned the correct tilesource to the sprite. From the error message it looks like there is no such animation.

1 Like

I’m sorry, but I really don’t understand what the problem is. Animation exists, on the “P” plays.

I tried to put the animation bullet, which is quietly used in the outline, it also refused to be put with the same problem.

For some reason the code works when I give the tilesource the name “test” but “destruct” is ignored…

Honestly, I have a feeling that the project itself is completely broken. The player’s sprite went crazy, even though I didn’t even touch it and started shrinking…

Could you upload your project for people to have a look so they can help you out?

1 Like

Thank you! Great idea, for some reason I forgot that files can be uploaded :sweat_smile:

Test.zip (574.3 KB)

Ok - first issue:

Your little spaceship looks weird because you have added a rotation to it:
Screenshot 2023-08-24 190656
Just set this to 0 and you can see it as it should be.

In case you wonder about the position - I’ve moved the game objects more to the middle of the screen to see them better.

4 Likes

Thank you very much. By the way, can you also see what is the problem with the enemy animation script? It’s just that I can’t figure out what the problem is and why when using tileset “test” the animation works.

1 Like

Just about to post this:

your animation in the “destruct.tilesource” is actually called “anim”:

So, either use “anim” instead of “destruct” in the code you posted - or rename:

tilesource:


sprite:

Now your script works for me and the enemy ship is destroyed without an error.

EDIT:
actually, sorry, you can’t see the enemy spaceship, just the explosion - you need to set the start tile of the animation to one (you have it at 4 atm)

6 Likes

You are my savior!

Note: Special thanks to everyone who contributed to this issue!

2 Likes

You are welcome! It is often those little things like naming things that seem to trip everything up - so check everything carefully.

2 Likes