@aipie love the keyframe suggestion! Will try that if I can't coax it into incrementing until it hits max, then decrementing until it hits minimum.
Regarding your note on the logic in 12 and 16, that's what I meant to type in my original post, actually! I had it backwards, and I fixed it in my own code after posting.
And in that state it shrinks down to 0 (ignoring my size_min) and then appears to expand forever... but what I just found is that it's actually just continuing to shrink forever, into negative numbers... apparently Godot takes negative values for scale and uses their absolute value, so it just keeps getting bigger the farther below zero it goes.
So obviously I have a case of my "if" statements not catching the overshoot on either end...
Current script:
extends Area2D
onready var bling = get_node("bling")
onready var size_min = 0.5
onready var size_max = 1.0
onready var should_shrink = true
onready var rate = 0.02
func _ready():
$Sprite.scale.x = 1
$Sprite.scale.y = 1
func _process(delta):
if should_shrink:
shrink(rate)
if scale.x <= size_min:
should_shrink = false
if not should_shrink:
grow(rate)
if scale.x >= size_max:
should_shrink = true
print ($Sprite.scale.x)
func shrink(amount):
$Sprite.scale.x -= amount
$Sprite.scale.y -= amount
func grow(amount):
$Sprite.scale.x += amount
$Sprite.scale.y += amount
Time to give my brain a break! Thanks in advance to anyone who can show me where my dumb mistake is :-)