![godot – How do you make a maintain word like in FNF godot – How do you make a maintain word like in FNF](https://thefuntrove.com/wp-content/uploads/https://cdn.sstatic.net/Sites/gamedev/Img/apple-touch-icon@2.png?v=9bca23db2259)
[ad_1]
I wish to make a longnote like within the sport Friday Night Funkin.
If you do not know FNF that is the lengthy notes: https://www.youtube.com/watch?v=dXZ5Zmnk6Yg
Code:
if (Input.is_action_pressed("up")) or (Input.is_action_pressed("down")) or (Input.is_action_pressed("proper")) or (Input.is_action_pressed("left")):
mouseheld = true
else:
mouseheld = false
if (isLongNote == true) and (Input.is_action_just_pressed("up") and touching == true and sprite.rotation_degrees == 0) or (Input.is_action_just_pressed("down") and touching == true and sprite.rotation_degrees == -180) or (Input.is_action_just_pressed("proper") and touching == true and sprite.rotation_degrees == 90) or (Input.is_action_just_pressed("left") and touching == true and sprite.rotation_degrees == -90):
createAEffect()
print(mouseheld)
if mouseheld == false:
Singletons.unhealthy()
queue_free()
print(mouseheld)
# COMMENT HERE
if mouseheld == true:
print('rlly good')
Singletons.sick()
queue_free()
else:
print('...')
Singletons.good()
queue_free()
The drawback is at the place I put a remark, I attempted to place a yield perform (mainly wait a second and see if the mouse remains to be held) however the yield perform (yield(get_tree().create_timer(1)), “timeout”) did not work (for some cause doesnt work within a perform)
Is there a greater method to do that?
[ad_2]