Files
MovementTests/guide_examples/top_down_shooter/top_down_shooter.gd
Minimata af1f6da98d
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 31s
Create tag and build when new code gets to main / Test (push) Has been cancelled
Create tag and build when new code gets to main / Export (push) Has been cancelled
updating project files
2026-01-28 09:50:10 +01:00

19 lines
576 B
GDScript

extends Node2D
@export var keyboard_and_mouse:GUIDEMappingContext
@export var controller:GUIDEMappingContext
@export var switch_to_controller:GUIDEAction
@export var switch_to_keyboard_and_mouse:GUIDEAction
func _ready():
# enable controller at the start
GUIDE.enable_mapping_context(controller)
# Switch the control scheme depending on the input.
switch_to_controller.triggered \
.connect(func(): GUIDE.enable_mapping_context(controller, true))
switch_to_keyboard_and_mouse.triggered \
.connect(func(): GUIDE.enable_mapping_context(keyboard_and_mouse, true))