I'm trying to decrease size of instanced RigidBody2DRigidBody2D
scene, through code.
With "scale()" methodscale()
, I'm trying to decrease the size of the image/sprite that's attached to the RigidBody2DRigidBody2D
. The problem is, it's not working.
No matter how much I try to scale down, the size of the blood drop circle remains the same.
Why is this?
This is my example code.
const blood_druple_scn = preload("res://Scenes/blood.tscn")
func spawnBlood():
var newBlood = Blood_druple_scn.instance()
rotationAdd = rotationAdd + 30
if(switchBloodSize == 0):
set_scale(Vector2(2,1)) //This part is my problem
print("blood size: ", newBlood.get_scale())
add_child(newBlood)
switchBloodSize = 1
elif(switchBloodSize == 1):
newBlood.scale(Vector2(0.5,0.5)) //This part is my problem
print("Blood size: ", newBlood.get_scale())
add_child(newBlood)
switchBloodSize = 0
newBlood.set_pos(Vector2(100,100))
rotate(rotationAdd)
As you can see, I have 2two different Ifif
conditions, each with a different scale()scale()
and size. Sadly they are, both remain the same size even tho I gave different values to each of them.
Strange The strange part is, that it does print thatdisplay the scale values hasas been altered. So I guess Blood, yet the newBlood
instance isn'tis not visually changing. Why is this?