For example, I created chess_piece.go in order to spawn it to many pieces. In this game object I have a sprite which I want to do animation on it (rotation). As far as I researched, we only do animation on game objects, not sprites. However when I right click on the game object, there’s no option for adding a game object on it.
My question is why I can’t do it on game object file while game objects in a collection can. Is there any good way to have animation on a part of a game object not a whole of it?
Please prefer this image to be clearer what I mean
A collection isn’t anything “big”, it is literally just a collection of game objects. In fact, you can’t reference a collection after it’s been spawned, only the game objects it contains. Don’t be afraid of using collections!
I am confused, the Defold manual contains the example:
local function play_idle_animation(self)
if self.dodge then
sprite.play_flipbook("#sprite", hash("dodge_idle"))
else
sprite.play_flipbook("#sprite", hash("idle"))
end
end
which made me think that animations are done ‘on the sprite’, or more specifically the meta-data of the sprite.
Yes, but we are talking about different types of animations. Flippbook animations are not the same as property animations. Since they wanted to use rotation, then that would be a propety animation, using go.animate