+1 vote

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)
in Engine by (48 points)

are you using godot 2.1.x?

No.
Godot 3.0.

1 Answer

+7 votes
Best answer

here is same question.

https://godotengine.org/qa/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.

by (9,712 points)
selected by

Thank you very much.
... Also, could you tell me about the other differences between Godot 3 and Godot 2?

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.