Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DerpyCoder |
So im starting in game development and i was trying to make a pause menu, but there is one problem. You see im making a 3D game and i want the cursor to be hidden when im not in the pause menu, but every video i watch, they are making a 2D game. Ill post the code at the end, Any help i can get?
extends Control
func _input(event):
if event.is_action_pressed(“ui_cancel”):
var new_pause_state = not get_tree().paused
get_tree().paused = not get_tree().paused
visible = new_pause_state