Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | 99 | |
Old Version | Published before Godot 3 was released. |
I get the error, Nonexistent function ‘move’ in base 'KinematicBody2D, when I run this script in Godot 3.0:
var vel = 0
func _process(delta):
if Input.is_action_pressed("acc") and vel < 5:
vel += 0.1
if Input.is_action_pressed("dec") and vel > -1:
vel -= 0.2
if Input.is_action_pressed("rmb"):
look_at(get_global_mouse_position())
move(Vector2(sin(rotation), cos(rotation)) * vel)
This works fine in Godot 2 (except ‘rotation’ is ‘get_rot()’). So, I thought the move function was changed, but everything I’m reading says it hasn’t… so, can someone explain what I’m doing wrong?