0% found this document useful (0 votes)
1 views17 pages

Lecture 9 Input

Uploaded by

Iqra Zafar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views17 pages

Lecture 9 Input

Uploaded by

Iqra Zafar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Lecture No 9

Game Programming
Aims of the lecture
 Game Controllers
◦ The input Manager
◦ Keyboard and Mouse processing
The Input Manager
The Input Manager
Conventional Input
Buttons and Keys
Buttons and Keys
As soon as the key/button is pressed,
GetButtonDown/GetKeyDown method and
GetButton/GetKey method Returns true for
the first frame

GetButtonDown/GetKeyDown method returns false As soon as the key/button is released or stopped


for the next frame (it resets to initial value after being being pressed, the GetButtonUp/GetKeyUp
triggered) but if the key is kept pressed, the method returns true during the frame it is released
GetButton/GetKey Returns true during all the frames
it kept pressed
GetAxis and GetAxisRaw

Nice animation in this video:


http://unity3d.com/learn/tutorials/modules/beginner/scripting/get-axis
GetAxis
GetAxis

Gravity : 100
GetAxis

Gravity : 0.1
GetAxis

Sensitivity : 100
GetAxis

Sensitivity : 0.1
Horizontal & Vertical Axes
GetAxisRaw
Mouse
Reading List
 https://docs.unity3d.com/ScriptReference/Input.html
 https://docs.unity3d.com/Manual/ConventionalGameInput.html
 https://unity3d.com/learn/tutorials/topics/scripting/getbutton-and-getkey
 https://unity3d.com/learn/tutorials/topics/scripting/onmousedown
 https://unity3d.com/learn/tutorials/topics/scripting/getaxis

You might also like