0 votes

I am following a tutorial and this error is coming up.

0:00:01:0857 - Condition ' _debug_parse_err_line >= 0 ' is true. returned: __null
Time: 0:00:01:0857
C Error: Condition ' _debug_parse_err_line >= 0 ' is true. returned: __null
C Source: modules/gdscript/gdscript_editor.cpp:287
C Function: debug_get_stack_level_instance

Identifier not found: rotation_dir

Here is the script:

extends RigidBody2D

export(float) var engine_thrust = 200
export(float) var spin_thrust = 2000

var thrust = Vector2()
var roation_dir = 0

func _ready():
    # Called when the node is added to the scene for the first time.
    # Initialization here

func _process(delta):
    if Input.is_action_pressed("ui_up"):
        thrust = Vector2(engine_thrust, 0)
        thrust = Vector2()

    if Input.is_action_pressed("ui_left"):
        roation_dir = -1
    elif Input.is_action_pressed("ui_right"):
        roation_dir = 1
        roation_dir = 0


func _integrate_forces(state):
    set_applied_torque(rotation_dir * spin_thrust)
in Engine by (13 points)
edited by

2 Answers

0 votes
var thrust = Vector2()
var roation_dir = 0

you typed roation_dir without t, not ro*t*ation_dir

by (9,796 points)
0 votes

The problem is that you defined roation_dirand used it everywhere, EXCEPT in _integrate_forces function, where you used rotation_dir. One says "roAtion" and the other "roTAtion".

Set all with the same name and it should work.

by (3,505 points)
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.