I have a card.go that I spawn using a factory. After spawning the cards I keep slightly rotating them along the z-axis but it look very bad if I don’t use a single sprite as the card.
Here is a card.go with two sprites and two labels as children:
Here is a card.go with only one sprite:
I am using the newest Defold release: 9b28d9589d24981c7eb13ce63fa0172222700387
Here is the relevant code:
local function card_wiggle(prev_dir)
local dir = -1 * prev_dir
go.animate(".", 'euler', FWD, vmath.vector3(0, 0, prev_dir), go.EASING_LINEAR, 3.0, 0, function ()
go.animate(".", 'euler', FWD, vmath.vector3(0, 0, dir), go.EASING_LINEAR, 3.0, 0, function ()
card_wiggle(prev_dir)
end)
end)
end
Is this some engine limitation? Am I forced to use a single sprite as a card if I want to have that slight rotating effect?
Honestly I would prefer to have one post-process shader do that but I have no idea if its possible to have it effect only the card game objects (that have multiple children components) and nothing else.