Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MemokingMH |
There is a problem in my script that does let me change monitorable of key at first if but not letting me in elif. Ground is working properly and I know this can be the least polished way of doing it but I don’t have time to make it more polished so if it works I don’t care.
Here is the error : Attempt to call function ‘set_monitorable’ in base ‘null instance’ on a null instance.
Note : Key is an Area2D
var active = false
func _process(delta):
if active == false:
$Ground.scale = Vector2(0.05, 0.05)
$Key.set_monitorable(false)
elif active == true:
$Ground.scale = Vector2(1, 1)
$Key.set_monitorable(true)
I’m changing active var in another script
Also I don’t care if solution has monitoring if it is workin. Also I already tried disableing collision shape but same problem