Object randomly scaling

Godot Version

4.5.1

Question

hey y’all I have a problem with scaling, the problem is when I added the randf_range scale of the obj started to sometimes not scale properly aka not 0.5, here’s the code:

pickedObject = objectsInRange[0]
pickedObject.scale = Vector3(0.5,0.5,0.5)
pickedObject.rotate_z(randf_range(-15.0,15.0))
pickedObject.set_selection(false)
pickedObject.set_collision(false)
pickedObject.reparent(opm)
pickedObject.global_position = opm.global_position

heres a screenshot of the wrong scaling

and correct scaling