Question
Ok, so to diverse myself in other concepts of coding, I’m making a angry birds clone just to test my programing. So far, the bird will try to go towards the cursor. Funny thing, it works while testing it in the scene i made it, but if I place it in another scene and playing in that one, everything gets dislocated and funky.
extends StaticBody2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var swing_pos : Vector2 = get_global_mouse_position()
$Node2D.position = swing_pos
#$RigidBody2D.position = $Node2D.position
$Label.text = str(swing_pos)
if Input.is_action_just_pressed("click"):
$RigidBody2D.linear_velocity = swing_pos
$RigidBody2D.gravity_scale = 0.5

