Hello!
I am new to programming and have a lot of gaps in my knowledge and could use an assist. I want to click and drag a kinematicBody2D. I got it to work in it's own scene but when I instantiate it into another scene it stops working. The kBody is still set to pickable and it is on the layer that is drawn last so I don't know why it no longer works. There has got to be something obvious I am missing. Any info would be much appreciated. Below are the screenshots and the code. Thanks!!
code for the scene that works on its own.
extends KinematicBody2D
var can_grab = false
func _input_event(viewport, event, shapte_idx):
if event is InputEventMouseButton:
can_grab = event.pressed
func _process(delta):
if Input.is_mouse_button_pressed(BUTTON_LEFT) and can_grab:
position = get_global_mouse_position()

code from the scene that I instantiated the above into.
extends Node2D
var bridgeActivated = false
var prievious_mouse_position = Vector2()
var is_dragging = false
func _ready():
$machineOff.hide()
$machineActivated.hide()
func _on_activate_toggled(button_pressed):
if (button_pressed):
$machineActivated.show()
$machineOn.hide()
$bridgeDoor1.play("bridgeOpening")
$bridgeDoor2.play("bridgeOpening")
$animationTimer.start()
bridgeActivated = true
else:
$machineActivated.hide()
$machineOn.show()
$bridgeDoor1.play("bridgeOpening", true)
$bridgeDoor2.play("bridgeOpening", true)
bridgeActivated = false
func _on_animationTimer_timeout():
$bridgeDoor1.play("bridgeLoop")
$bridgeDoor2.play("bridgeLoop")
