Think Monster extends Creature.
Creature has the variable Speed and the function getforwardvector().
Monster.gd:
extends "res://Scripts/Creature.gd"
func _ready():
set_fixed_process(true)
func _fixed_process(delta):
var Sa = get_forward_vector()
#gives the error "Invalid call. Nonexistent function
'get_forward_vector' in base 'KinematicBody2D (Áspher.gd)'."
var Sp = Speed
#gives the error "Parser Error: Identifier not found: Speed"
Creature.gd:
extends KinematicBody2D
export var Speed = 150
var Direction = 0
func get_forward_vector():
if (Direction == 0):
return Vector2(0, 1)
elif (Direction == 1):
return Vector2(-1, 0)
elif (Direction == 2):
return Vector2(0, -1)
elif (Direction == 3):
return Vector2(1, 0)
How can I get/use those? I tried simply putting them in and it didn't work. Can you make an example?