0 votes

Beginner here

Can someone briefly explain me the difference between input and _unhandledinput functions in gdscript

Thanks in advance =)

Godot version 3.4.4 stable
in Engine by (70 points)

1 Answer

+1 vote
Best answer

An input is an event which has been assigned some kind of characteristic.

The system will first check if an input is assigned a function, if not it will check if it is a control input (e.g. a control pad) and finally it will check if it is a collision object (only relevant to things like area 2d's etc). If it hasnt done anything with any of these it is an unhandled input.

For example lets say you havent assigned P to anything, when the user clicks P it will run through that and conclude there is no handling of the event and go to any code you have for unhandled events. Now if you go to key mapping and assign P to a function like pause, the game will check and find it is assigned to a function so it will never fall to an unhandled event code.

by (2,001 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.