Godot Version
4.3
Question
I have a resource that looks something like this:
extends Resource
class_name LootTableItem
@export var item: Resource
@export var weight: int
is there a way for me to set the weight property through the item’s setter based on a condition of the item? I’ve tried this:
@export var item: Resource:
set(value):
if value.get("rarity"):
weight = value.rarity
but this doesn’t work.
Is there any way to achieve this?