I don't really know how to do but maybe I can give you what is the error and the line of code that not work.
ERROR: Edit state is only for editors, does not work without tools compiled.
at: (scene/resources/packedscene.cpp:1642)
SCRIPT ERROR: Attempt to call function 'Normal' in base 'null instance' on a null instance.
at: Normalstate (res://Player/Ketchup.gdc:86)
Code at line 86:
var Bullet = preload("res://Bullet/Bullet.tscn")
onready var animationTree = $AnimationTree
onready var animationPlayer = $AnimationPlayer
onready var animationState = animationTree.get("parameters/playback")
onready var ray = $RayCast2D
onready var shootingPosition = $ShootingPosition
onready var ShotGunPosition1 = $ShotGunPosition1
onready var ShotGunPosition2 = $ShotGunPosition2
onready var ShotGunPosition3 = $ShotGunPosition3
onready var hitbox = $HitBox
onready var Facher = $Facher
func ready():
animationTree.active = true
stats.connect("nohealth", self, "queuefree")
position = position.snapped(Vector2(tilesize, tilesize))
lastposition = position
target_position = position
func physicsprocess(delta):
match state:
MOVE:
move_state(delta)
func shooting_state():
if Ketchup.shootingType == 0:
Shoot = Normal
elif Ketchup.shootingType == 1:
Shoot = ShotGun
elif Ketchup.shootingType == 2:
Shoot = SuperFire
match Shoot:
Normal:
#audioShooting.play()
animationState.travel("Shooting")
hitbox.set_deferred("monitorable", false)
ShotGun:
#audioShooting.play()
animationState.travel("ShotGun")
hitbox.set_deferred("monitorable", false)
SuperFire:
#audioShooting.play()
animationState.travel("SuperFire")
hitbox.set_deferred("monitorable", false)
func shoot():
#match Shoot:
#Normal:
# Normal()
#ShotGun:
# ShotGun()
#SuperFire:
# SuperFire()
func Normalstate():
#audioShooting.pitchscale = 0.6
#audioShooting.play()
hitbox.setdeferred("monitorable", false)
shootingstate()
var bullet = Bullet.instance(1)
bullet.BulletType = Normal
bullet.scale.x = 1
bullet.scale.y = 1
getparent().addchild(bullet)
bullet.position = shootingPosition.global_position