Here's my code:
func update_attachments():
var i: int = 0
for attachment in [stock]:
i += 1
for stat in ['fire_rate','bounces','reload_time','mag_size','inaccuracy','bullet_speed']:
# Modify stats.
ClassDB.class_set_property(self,stat,ClassDB.class_get_property(self,stat) + attachment.modifications[stat])
match i:
1:
quot;rotation_helper/Camera3D/Pistol Base/Stock".mesh = load(attachment.model)
attachment
is a custom resource with a dictionary dictating stat changes made by the attachment. All the keys are variables in the Player
script. No idea why it's returning nil
.
0 comments