+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:

func _ready():

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)

in Engine by (48 points)

are you using godot 2.1.x?

Godot 3.0.

1 Answer

+7 votes
Best answer

here is same question.


func _ready():

func _physics_process(delta):

_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,796 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 Frequently asked questions and 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 [email protected] with your username.