Godot Version
4.2.1
Question
I created a scene as PackedScene and loaded it from a script.
The scene Arrow.tscn has a script on the root, but the instantiated object(arrow) does not have that script.
Here is a part of my codes.
[Gameplay.gd]
...
arrow_scene = preload("res://Scenes/Arrow.tscn")
# arrow's class is Node2D and I want Arrow class as a result
var arrow = arrow_scene.instantiate()
...
[Arrow.gd]
extends Node2D
class_name Arrow
var speed
var aim
func _init(given_tag):
speed = 50
...