0 votes

im making a project for listening to episodes of a podcast (the magnus archives) as if they're real cassettes. The idea is that some info about the episode shown on the cassette model + it's audio file are stored in a class, then before putting the cassette in the player, being able to change the class resource the cassette takes from with buttons. My problem is that it doesnt let me change it on runtime, just set it on the ready function.
The way the cassette script loads the data:

onready var data = preload("res://MAGs/Season1/Ep1.tres")

The way im trying to change it:

func _ep_select():
    data = load(<different cassette's data>)

I apologize for if im making a dumb mistake, ive barely worked with classes. Also if its impossible to change it on runtime, what should i use instead to save the data in?

Godot version 3.5stable.official
in Engine by (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.