Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | omarsherif |
i was following a toutorial on youtube and i get stuck at the set and get_pos() proplem
i get Error msg
invalid call. nonexistance function ‘get_pos’ in base ‘spirite’.
i just need the answer or if there is an equivelent function that have the same purpose
i need to move the object from one point to another using the arrow keys it is a ping bong game and here is a code sample
func _ready():
set_process(true)
pass # Replace with function body.
func _process(delta):
var LeftPos = get_node("Left Player").get_pos()
if (Input.is_action_pressed("LeftPlayer UP")):
LeftPos.y += -padspeed * delta
if (Input.is_action_pressed("LeftPlayer Down")):
LeftPos.Y += padspeed * delta
get_node("Left Player").set_pos()