0 votes

I was following a tutorial on the godot website and came across this error
This is the code so far:

extends Node

export(PackedScene) var mob_scene
var score

func ready():
randomize()
new
game()

func game_over():
$ScoreTimer.stop()
$MobTimer.stop()

func new_game():
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()

func onStartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()

func onScoreTimer_timeout():
score += 1

func onMobTimertimeout():
var mob
spawnlocation = getnode("MobPath/MobSpawnLocation");
mobspawnlocation.offset = randi()

var mob = mob_scene.instance()
add_child(mob)

var direction = mob_spawn_location.positon + PI / 2  #This is where the error 
mob.position = mob_spawn_location.position            #occurs.

direction += rand_range(-PI / 4, PI / 4)
mob.rotation = direction

var velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
mob.linear_velocity = velocity.rotated(direction)
Godot version 3.2.3-stable
in Engine by (35 points)

1 Answer

0 votes

You wrote positon, not position.

by (21,930 points)

OMG Thanks i feel so stupid now ☺

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.