![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | TheSlimeDev |
in my game i want a Remote transform node to move my camera boundaries when i enter an area2d but i keep getting "Invalid get index ‘Isinmap’ (on base: ‘null instance’) and when i run it it shows a blank scene.
parent script :
extends Area2D
onready var Isinmap = false
func _on_00_body_entered(_body):
Isinmap = true
func _on_00_body_exited(_body):
Isinmap = false
child script :
extends RemoteTransform2D
var Parent = get_parent()
var isinmap = Parent.Isinmap
func _process(_delta):
if isinmap != true :
set_remote_node(“/root/Camera2D/limits/cambottomright”)
else:
set_remote_node("/Parent/bottomright/")
in a backup i deleted all the area2ds and scripts and the game worked fine and i have been working for hours
maybe shortcutting get_parent()
ruins it, try to do just var isinmap = get_parent().Isinmap
vania23 | 2022-12-10 18:53