Hello Godotneers! If you've worked a bit with Godot's way of handling input, you may have noticed that there are a few things which are not as straightforward to do as they could be. We need to write different code each type of input (keyboard, mouse, controllers) which makes it difficult to support multiple input devices at the same time. We also cannot bind some types of inputs like mouse movement or input combinations like "left trigger + a" to an action so our input code can get quite complex as our game grows.
So in this video we look at how to handle all input in a single and very simple way with G.U.I.D.E - a new library for the Godot game engine. We'll use a 3D tower defense game as an example and implement different game modes which use mixed input in different situations while keeping our code neat and tidy. And as always we have an example project to follow along, so fire up your Godot engine and have some fun exploring a nice and simple way to handle all kinds of input in your game!
Table of contents
================
00:00 Introduction
02:13 Goals
03:16 Installing G.U.I.D.E
04:27 Actions
06:07 Mapping contexts
06:39 Mapping actions to input
07:16 Input configuration dialog
08:22 How do we want our input to work?
08:56 Input representation
09:38 Input modifiers
12:14 Handling input in code
14:26 Enabling mapping contexts
15:52 The G.U.I.D.E debugger
17:18 Handling mouse input
19:02 Resolution independence
21:11 Mouse input in code
23:25 Camera rotation
26:36 Triggers
30:14 Checking trigger state in code
30:51 Trigger signals
31:38 implementing build mode
32:43 Multiple mapping contexts
33:27 Switching between modes
35:13 Mode switching in code
39:22 Camera panning in build mode
42:09 Tower placement action setup
44:39 Tower placement plan of attack
46:12 Tower placement implementation
48:34 Converting 2D input into 3D input
51:27 2D input to canvas coordinates
54:35 Placing the towers
57:00 Conclusion
Useful links
==========
The example project we use in this video: https://github.com/godotneers/guide-v...
G.U.I.D.E documentation: https://godotneers.github.io/G.U.I.D.E/
Godotneers transforms video: • Transforms in Godot - elegantly solve...
If you'd like, you can support me - https://ko-fi.com/derkork
Смотрите видео A G.U.I.D.E to input in Godot онлайн без регистрации, длительностью online в хорошем качестве. Это видео добавил пользователь Godotneers 25 Декабрь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 12,909 раз и оно понравилось 759 людям.