Godot Input Event Example

I want to do a simple board game. Lots of things, I don’t really understand, example the input events. I read the Godot documentation on Input Event but they didn’t provide any project example besides the code.

For beginner, it is not straight forward. So I share the project Input Event example based on the Godot documentation example.

Steps To Do

1. Create Godot Project

2. Create New Input Map

– Click Project -> Project Settings

godot project settings
godot project settings

– Choose Input Map tab

godot - input map
godot – input map

– Find ui_right and choose the right key on your keyboard
– Then click OK
– Do the same with ui_left

3. Test it, by pressing the keys on your game.

– The text will appear on the output screen

godot - output screen
godot – output screen

Add Custom Input Map – Mouse Left Button Click

1. Go to project -> Project Settings

2. Type ui_mouse_left_button_click (you can give any name)

godot - add new input map
godot – add new input map

3. Click Add

4. Add left button event to the Input Map

godot - mouse left button click input map
godot – mouse left button click input map

 

godot - added mouse left button click
godot – added mouse left button click