Multiple components hate rotating go parents? (SOLVED)

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.

:arrow_down: Here is a card.go with two sprites and two labels as children:

:arrow_down: 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.

Looks strange to be honest. One thing which comes to mind is some kind of precision issue in the material. Or the fact that there is some conversion going on in the engine between euler and quaternions.

Are you able to share a minimal project?

I found the reason for this issue as I was making the minimal project. Subpixels for both label and sprite were off! :grin:

So I guess it works as intented. :stuck_out_tongue:

1 Like

Glad you found the issue :smiley:

I don’t know what style you are pursuing, but perhaps this might be interesting for you:

1 Like