![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | rainswell |
I have a simple testing script which allows me to move a node around based on different inputs from my keyboard which I can change per node (think WASD and IJKL). Ever since I updated to 3.3 I’ve been getting an error. Sometimes I’ll make changes to a script like this that inherits from Node, and all of a sudden I’ll get an error:
“The identifier global_position isn’t declared in the current scope”
Now this same script had been working before, so I’m not sure if I changed something I’m not aware of. Here’s my code:
extends Node
export var speed : float = 1
export(String, "Motor 1", "Motor 2") var motor = "Motor 1"
func _process(delta):
var movedirection
if motor == "Motor 1":
movedirection = testdir.direction_from_input_test1()
elif motor == "Motor 2":
movedirection = testdir.direction_from_input_test2()
global_position = global_position + (movedirection * speed)
Does anyone have any ideas? I’m guessing I’m misunderstanding the intended use of something. Thanks very much for your time.
Edit: I should mention closing and re-opening the editor doesn’t fix it.