Wasted a whole afternoon on this one but it doesn’t work. Am I missing something?
I want to do a simple “breathing” animation on each of my player sprites. I created a game object and assigned it a sprite and script component. On init()
I start an endless animation loop which deforms #sprite
's scale
property.
^What I get is this^ - It scales the sprite from the center point. I need the motion to happen from the center_x and bottom_y (the feet). My idea was to shift its position.y
on each update()
by the amount at that the sprite was scaled. Please see my code…
The debug does seem to return valid data which would proof that the calculations are correct (or do I miss the forest for the trees)? Anyway, given that the output is correct, why is it not translating right and why is it jumping instead of smoothly lerp-ing? I tried to do this with vmath.lerp
but same result.
# PS: Here is what the prefab for that GO looks like