Topic was automatically imported from the old Question2Answer platform.
Asked By
keito940
Old Version
Published before Godot 3 was released.
Since I got an error like this please let me know a bit: Invalid call. Nonexistent function 'set_fixed_process' in base 'KinematicBody2D'()
It’s on the line: set_fixed_process(true)
func _ready():
set_fixed_process(true)
func _fixed_process(delta):
var x = get_pos().x
var y = get_pos().y
var dir = 0
if Input.is_action_pressed("ui_left"):
dir = -1
if Input.is_action_pressed("ui_right"):
dir = 1
var move = Vector2(dir*speed*delta,0)
set_pos(get_pos()+move)
if _physics_process is defined in your script, set_physics_process(true) is automatically called.
so don’t need to call it in _ready unless you want to set it on/off on demand.
and there will be more script error because it’s 2.x code.
there have been many changes on script.
in-editor documents will help.
Thank you very much.
… Also, could you tell me about the other differences between Godot 3 and Godot 2?