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
----------
Type:Error
Description: 
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
    pass

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

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

    pass

func _integrate_forces(state):
    set_applied_force(thrust.rotated(rotation))
    set_applied_torque(rotation_dir * spin_thrust)
    pass
asked Jan 21 in Projects by Fire (13 points)
edited Jan 21 by volzhs

2 Answers

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

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

answered Jan 21 by volzhs (9,224 points)
0 votes

Hi,
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.

answered Jan 21 by p7f (1,908 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 How to use this Q&A? before posting your first questions.