Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:06,656 --> 00:00:12,800
So what if I wanted to allow the player
2
00:00:13,312 --> 00:00:15,616
Actually use the keyboard to move
3
00:00:16,128 --> 00:00:16,640
The Block
4
00:00:17,408 --> 00:00:22,016
I'm back in the unity and clean up a little bit so it's delete these here
5
00:00:22,528 --> 00:00:25,344
So now all we have is a player I'm going to save our scene
6
00:00:25,856 --> 00:00:28,928
And what we can do is actually go to our unity
7
00:00:29,184 --> 00:00:34,304
Input 2-litre project settings here you can actually go to the input manager
8
00:00:34,816 --> 00:00:40,960
And it says your this is where you can configure the controls to use with the unity engine that input
9
00:00:41,472 --> 00:00:43,520
So all this really does
10
00:00:43,776 --> 00:00:49,920
Is it allows us to basically map which keys are part of which category security we have
11
00:00:50,176 --> 00:00:55,040
Fire to fire shooting maybe that's reloading is a jump
12
00:00:55,552 --> 00:00:58,368
Mouse x Direction y Direction
13
00:00:58,624 --> 00:01:01,293
Is all sorts of various what they called axes
14
00:01:01,295 --> 00:01:03,771
Subtitled by
-♪ online-courses.club ♪-
We compress knowledge for you!
https://t.me/joinchat/ailxpXoW3JVjYzQ1
15
00:01:03,772 --> 00:01:09,120
So we can go to the horizontal one this is where the player is going to move left and right and you'll see it's name is horizontal
16
00:01:09,376 --> 00:01:12,192
And the negative button is the last key
17
00:01:12,448 --> 00:01:14,240
The positive button is the right key
18
00:01:14,752 --> 00:01:20,128
The alternative negative button is a that's what I usually like to use when I'm playing game for the keyboard
19
00:01:20,640 --> 00:01:22,688
An alternative positive bunnies
20
00:01:23,200 --> 00:01:24,224
You guessed it die
21
00:01:25,248 --> 00:01:28,064
The same sort of logic applies for vertical as well
22
00:01:28,576 --> 00:01:30,112
Down key up key
23
00:01:30,624 --> 00:01:31,648
S in double
24
00:01:31,904 --> 00:01:36,256
And Paisley what happens when I press any of these keys
25
00:01:36,512 --> 00:01:38,304
You basically smooth
26
00:01:38,816 --> 00:01:44,960
The value of the flow values in the case of horizontal when I press the d key it's moves to pass
27
00:01:45,216 --> 00:01:45,984
1 or
28
00:01:46,240 --> 00:01:47,264
Another way of putting it
29
00:01:47,520 --> 00:01:48,288
Lyrics
30
00:01:49,056 --> 00:01:54,176
And eases towards positive one when I let it go it eases back 20
31
00:01:54,688 --> 00:01:56,480
Anyway press left
32
00:01:56,736 --> 00:01:59,040
The negative button it goes to -1
33
00:01:59,296 --> 00:02:00,576
Can I could show you
34
00:02:01,600 --> 00:02:03,904
How is works in our scrap
35
00:02:04,160 --> 00:02:05,440
Search a script here
36
00:02:05,696 --> 00:02:08,256
In all going to do is type input
37
00:02:08,512 --> 00:02:10,048
Dad get access
38
00:02:12,864 --> 00:02:13,632
An end
39
00:02:14,656 --> 00:02:15,936
Quotes horizontal
40
00:02:16,960 --> 00:02:18,752
X speed
41
00:02:19,520 --> 00:02:21,568
X x delta time
42
00:02:22,080 --> 00:02:23,104
So
43
00:02:23,360 --> 00:02:24,640
To review here
44
00:02:25,152 --> 00:02:26,688
Our position is going to
45
00:02:27,200 --> 00:02:29,504
Increase along the x-axis
46
00:02:31,552 --> 00:02:37,696
This is the x axis equation basically so my current horizontal value which is
47
00:02:37,952 --> 00:02:43,072
Going to be one if I'm pressing d or negative one of them putting a or left to right on the keyboard
48
00:02:43,584 --> 00:02:46,400
X the speed value
49
00:02:47,168 --> 00:02:50,752
And we could actually rename this to be a little bit more
50
00:02:51,008 --> 00:02:52,032
I guess into it
51
00:02:52,544 --> 00:02:57,408
So let's do a speed multiplier make sure we take that and copy down here
52
00:02:57,664 --> 00:02:59,712
So what are Speed multiplier
53
00:03:00,992 --> 00:03:02,016
NN x
54
00:03:02,272 --> 00:03:04,832
Our time that delta time to insure it
55
00:03:05,088 --> 00:03:08,416
Not dependant on the frame rate of each computer that's playing the game
56
00:03:08,672 --> 00:03:10,208
Can we get say that out
57
00:03:11,232 --> 00:03:14,816
And what's my car speed multiplier just a value of 1
58
00:03:15,072 --> 00:03:17,376
Fell in save r script
59
00:03:17,888 --> 00:03:22,240
Will we go back into unity we wait for it to compile looks like we have no ears
60
00:03:23,008 --> 00:03:26,080
Go ahead and hit play and see if it actually works
61
00:03:28,384 --> 00:03:32,736
So when I'm pressing the right key at the ride on a personal f key
62
00:03:33,504 --> 00:03:34,528
I can go to the left
63
00:03:35,296 --> 00:03:36,320
Very cool
64
00:03:37,344 --> 00:03:39,904
And guys we can use the same sort of logic
65
00:03:40,416 --> 00:03:43,488
In the Y Direction as well so it's jump back in or scripture
66
00:03:44,768 --> 00:03:47,584
And just simply copy this
67
00:03:48,864 --> 00:03:50,400
Entire equation here
68
00:03:51,424 --> 00:03:54,240
Empire Cinema y axis Museum at here
69
00:03:54,752 --> 00:03:56,032
Tell some sort of
70
00:03:56,544 --> 00:04:00,384
Logical exactly just copy the speed multiplier and the Delta time
71
00:04:00,640 --> 00:04:03,456
In remove it completely
72
00:04:03,712 --> 00:04:05,760
And I just multiply it here
73
00:04:07,040 --> 00:04:09,088
Can we do I have to do it multiple times
74
00:04:11,136 --> 00:04:11,904
Say that out
75
00:04:12,672 --> 00:04:18,815
And what I also want to do is just go ahead and serialise this private speed multiplier value
76
00:04:19,327 --> 00:04:21,887
So that we can go and tell immunity in twechar
77
00:04:22,655 --> 00:04:23,679
Twilighting
78
00:04:24,703 --> 00:04:26,239
Go ahead and hit play here
79
00:04:28,799 --> 00:04:34,431
As you can see we have a bit of a bug and pressing left and right here but for some reason it
80
00:04:34,687 --> 00:04:36,223
Putting us up and down
81
00:04:36,991 --> 00:04:38,015
Why is that
82
00:04:38,527 --> 00:04:40,319
What's go back into r script
83
00:04:40,831 --> 00:04:43,135
You can see it didn't actually fire and air
84
00:04:43,647 --> 00:04:49,791
Not all bugs are simply glitches or errors sometimes there but you intentionally put another code in you didn't realise
85
00:04:50,303 --> 00:04:52,095
Solihull planning notice
86
00:04:52,863 --> 00:04:55,167
I have two horizontal values
87
00:04:55,423 --> 00:04:57,471
My field here
88
00:04:58,239 --> 00:05:01,311
I'm at the second value in the vector3 is y
89
00:05:01,823 --> 00:05:03,359
Play music vertical
90
00:05:04,639 --> 00:05:05,663
Don't save it out
91
00:05:06,175 --> 00:05:07,455
And let it play
92
00:05:08,735 --> 00:05:10,271
Set looks like I move left and right
93
00:05:10,783 --> 00:05:12,319
Up and down very good
94
00:05:13,343 --> 00:05:14,111
Alright
95
00:05:15,647 --> 00:05:18,207
Telescope hinges selespeed x 5
96
00:05:18,463 --> 00:05:18,975
Save it
97
00:05:19,487 --> 00:05:20,255
And
98
00:05:20,511 --> 00:05:24,863
This will probably be a great way to explain what's happening
99
00:05:25,119 --> 00:05:28,447
Do you know this How I slowly decelerate
100
00:05:28,959 --> 00:05:32,287
That actually because when I release the left key
101
00:05:32,799 --> 00:05:34,079
In this case I'm pressing
102
00:05:35,103 --> 00:05:36,639
A and releasing it
103
00:05:38,687 --> 00:05:44,831
The left input value is actually lerping or smoothing or easing back towards
104
00:05:45,087 --> 00:05:46,623
Slowly goes back to zero
105
00:05:47,135 --> 00:05:48,671
Now it's one
106
00:05:49,183 --> 00:05:51,231
And then I'll let go and it slowly
107
00:05:51,487 --> 00:05:52,767
Goes back to zero
108
00:05:53,279 --> 00:05:56,095
Just to clarify that let's go ahead and just debugger
109
00:05:56,351 --> 00:05:57,119
Debug
110
00:05:57,631 --> 00:05:58,655
That log
111
00:06:01,215 --> 00:06:04,799
And you'll use this one I like I said memorise debug.log
112
00:06:05,567 --> 00:06:07,359
Let's check the horizontal
113
00:06:07,871 --> 00:06:09,407
Value and see what it is
114
00:06:13,503 --> 00:06:14,527
Play here
115
00:06:15,039 --> 00:06:17,343
And take a look in the console window
116
00:06:17,599 --> 00:06:18,623
What the value is
117
00:06:19,135 --> 00:06:25,279
If you ever see them stacking like this it's certainly annoying so all we have to do is click collapse
118
00:06:25,791 --> 00:06:28,095
And now that shop in one
119
00:06:28,863 --> 00:06:30,143
Field hearing you can see that
120
00:06:31,167 --> 00:06:32,447
This is the amount
121
00:06:32,703 --> 00:06:33,727
Earth x
122
00:06:33,983 --> 00:06:38,079
That this message has been communicated and right here is the actual value
123
00:06:38,591 --> 00:06:40,383
So if I press left here
124
00:06:41,407 --> 00:06:43,711
You see the value is 1
125
00:06:44,223 --> 00:06:47,039
-1 almost -1
126
00:06:47,295 --> 00:06:50,879
Got the right almost positive one in it goes back to zero
127
00:06:52,671 --> 00:06:54,207
So that is what's happening
128
00:06:54,463 --> 00:06:57,023
When we use input that get access
129
00:06:58,047 --> 00:07:04,191
So that is how we move the player
9354
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.