I have a error

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Fire

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
:bust_in_silhouette: Reply From: volzhs
var thrust = Vector2()
var roation_dir = 0

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

:bust_in_silhouette: Reply From: p7f

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.