Godot Version
v4.6.2.stable.arch_linux [001aa128b]
Question
Hi!
I have a class called Enemy, which stores relevant info like max_health, it’s texture, etc.
I use ResourceLoader.load() to load the resource, but the problem is that the loaded data is shifted by a few fields.
This is the version on the disk:
And this is the one loaded:
The name, type, rotation, infested and the texture are all loaded correctly. But the numbers are mostly 0 and the value of max_health (19) is loaded into move_range. I tested with other enemies and this happens the same.
No error is produced when loading the resource.
Do you know what could be the cause of this?
Any info is appreciated ![]()
Enemy.gd:
extends Resource
class_name Enemy
enum Type {
BOSS,
ELITE,
MELEE,
RANGED,
SUPPORT,
}
@export var name: Name = Name.new()
@export var type: Type
@export_group("Stats")
@export var move_range: int:
set(value):
move_range = maxi(0, value)
@export var attack_range: int:
set(value):
move_range = maxi(0, value)
@export var attack_damage: int:
set(value):
move_range = maxi(0, value)
@export var max_health: int:
set(value):
move_range = maxi(1, value)
@export var block: int:
set(value):
move_range = maxi(0, value)
@export_group("Rotation")
@export var rotation: Array[Phase]
@export_group("Act Feature")
@export var infested: bool
@export_group("Other")
@export var texture: Texture2D
@export_group("")
How I load the enemy:
var e: Enemy = ResourceLoader.load("res://resources/enemies/wastelands/infested_black_spider.tres")

