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)
asked Jan 21, 2019 in Projects by Fire (13 points)
edited Jan 21, 2019 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, 2019 by volzhs (9,462 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.

answered Jan 21, 2019 by p7f (2,650 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.