Invalid call. Nonexistent function 'set_fixed_process' in base 'KinematicBody2D()'

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By keito940
:warning: 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)

are you using godot 2.1.x?

volzhs | 2017-11-07 03:40

No.
Godot 3.0.

keito940 | 2017-11-07 04:09

:bust_in_silhouette: Reply From: volzhs

here is same question.

https://forum.godotengine.org/18871/what-is-the-new-equivalent-of-fixed_process-in-godot-3-0?show=18871#q18871

func _ready():
    set_physics_process(true)

func _physics_process(delta):
    pass

_fixed_process is changed to _physics_process

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?

keito940 | 2017-11-08 06:19