Hi! I’m having a problem. I’ve just started experimenting with components in Godot and don’t understand how to use properties with multipliers.
Right now, I have a component like this; it determines the experience gain radius:
class_name ExpCollectorComponent
extends Area2D
@onready var exp_collector_area: CollisionShape2D = %ExpCollectorArea
var current_exp_collection_radius: float
var max_exp_collection_radius: float
func set_stats(radius: float, max_radius: float) -> void:
current_exp_collection_radius = radius
max_exp_collection_radius = max_radius
set_exp_collection_area_radius()
func set_exp_collection_area_radius() -> void:
exp_collector_area.shape.radius = current_exp_collection_radius
I also have a resource containing my character’s stats, which includes variables for the base experience gain radius and the multiplier for that radius. That is, if in the game I, for example, take an upgrade that increases my experience gain radius by 20%, then the multiplier becomes 1.2 and the radius itself should change and become 20% larger:
class_name PlayerBasicStatsData
extends Resource
@export var collection_exp_radius: float = 80.0
@export var max_collection_exp_radius: float = 1000.0
@export var collection_exp_radius_multiply: float = 1.0
And now I just can’t figure out where to do these calculations—something like current_exp_collection_radius * collection_exp_radius_multiply?
Also, considering that I’d like to make this component as independent as possible. That is, it could be used, for example, by a player who has an experience collection radius multiplier, and by an NPC who might not have that multiplier.
Please let me know where this needs to be calculated and how to do it correctly.

