Topic was automatically imported from the old Question2Answer platform.
Asked By
lokineo
trying to press “c” key then freeze the enemy and then after timeout enemy continuous to move again by using autoload. I am able get the enemy freeze but i cannot set timestopfreeze = false again, something wrong with my timer in Global autoload script and not sure what went wrong. If you can point how my timer setup wrong ,
hope i explained it well and any help will be most appropriate
cheers
Player script
onready var globleEffect = get_node("/root/GlobleEffect")
func _integrate_forces(_s):
if Input.is_action_just_pressed("Attack"):
globleEffect.timestopfreeze = true
globleEffect.timeStopFreezeTimer.start()
Your problem is that the autoload script will only run the _ready() function on start up not when you need it. You would be better off putting something like this in the enemy script