I have a timer in my Main scene and I want to be able to change its wait time according to how fast the game is. So I attached a script to this ObstacleTimer and I wrote:
extends Timer
func _change_wait_time():
if TimeManager.VELOCITY >= 5.5:
Timer.wait_time = 1.0
elif TimeManager.VELOCITY >= 3.5:
Timer.wait_time = 2.0
else:
Timer.wait_time = 3.0
func _process(delta: float):
_change_wait_time()
This give me the following error:
Invalid set index 'wait_time' (on base: 'GDScriptNativeClass') with value of type 'float'.
I tried changing from float to int, but it gives me a similar error:
Invalid set index 'wait_time' (on base: 'GDScriptNativeClass') with value of type 'int'.
Can anyone help me solve this?