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,544
What the heck does boy mean
2
00:00:13,312 --> 00:00:14,336
It is a lie
3
00:00:14,592 --> 00:00:17,664
It's actually in front of any function anytime you see the word void
4
00:00:17,920 --> 00:00:19,968
It means there's a function here
5
00:00:20,480 --> 00:00:22,272
Function again can be start
6
00:00:22,528 --> 00:00:25,344
It can be an update function which happens all the time
7
00:00:25,600 --> 00:00:28,672
Give me a custom function like checked checked boundaries
8
00:00:28,928 --> 00:00:29,440
Hurt
9
00:00:30,208 --> 00:00:31,488
All void means
10
00:00:31,744 --> 00:00:32,768
Houses kind of weird
11
00:00:33,536 --> 00:00:35,584
You need to start going to return anything
12
00:00:36,096 --> 00:00:38,400
So I had a function called void
13
00:00:38,912 --> 00:00:39,936
Calculator
14
00:00:42,496 --> 00:00:44,288
Calculate equation
15
00:00:45,824 --> 00:00:49,664
What if I wanted it to calculate an equation in return something
16
00:00:50,432 --> 00:00:51,968
All we do is we actually call it
17
00:00:52,992 --> 00:00:53,504
A
18
00:00:53,760 --> 00:00:54,272
Note
19
00:00:55,040 --> 00:00:56,064
Calculator
20
00:00:56,320 --> 00:00:57,600
And all I would be is
21
00:00:57,856 --> 00:01:00,141
Type return tent
22
00:01:00,143 --> 00:01:02,491
Subtitled by
-♪ online-courses.club ♪-
We compress knowledge for you!
https://t.me/joinchat/ailxpXoW3JVjYzQ1
23
00:01:02,492 --> 00:01:01,696
Fr10
24
00:01:01,952 --> 00:01:02,720
5 f
25
00:01:02,976 --> 00:01:03,488
Plus
26
00:01:04,768 --> 00:01:06,304
5.1 f
27
00:01:06,816 --> 00:01:10,144
Alternative it's going to return a float value
28
00:01:10,400 --> 00:01:11,168
Psycho
29
00:01:11,680 --> 00:01:12,192
Pier
30
00:01:12,448 --> 00:01:13,728
In my update I could say
31
00:01:14,240 --> 00:01:16,544
Put an update let's put it in the store
32
00:01:17,056 --> 00:01:17,824
I could say
33
00:01:18,080 --> 00:01:19,104
Calculate
34
00:01:19,360 --> 00:01:19,872
Equation
35
00:01:21,152 --> 00:01:23,712
So all this is going to do is calculate the equation
36
00:01:23,968 --> 00:01:24,992
In the store
37
00:01:25,248 --> 00:01:29,856
What am I going to see there so the way that we see this is we just simply say debug.log
38
00:01:30,624 --> 00:01:32,672
NN calculate equation
39
00:01:33,184 --> 00:01:34,464
It was just going to show us
40
00:01:34,720 --> 00:01:36,000
What that value is
41
00:01:36,256 --> 00:01:37,280
In the console
42
00:01:38,304 --> 00:01:40,608
Honestly guys you don't need to worry about this too much
43
00:01:40,864 --> 00:01:47,008
I got it mate I didn't really figure any of this stuff out until like 4 or 5 years that I started coding
44
00:01:47,264 --> 00:01:53,408
Which is honestly embarrassing to admit but I never really needed it I got oh I get away with not
45
00:01:54,432 --> 00:01:55,456
Return value
46
00:01:55,968 --> 00:01:58,272
Again just to clarify
47
00:01:58,528 --> 00:02:00,320
Void means nothing's return
48
00:02:01,600 --> 00:02:07,232
Anytime you put an actual variable type here like a float or a bullying or a string
49
00:02:07,744 --> 00:02:09,280
Some kind of variable type
50
00:02:09,792 --> 00:02:11,072
As a function
51
00:02:11,840 --> 00:02:14,144
I just simply means it's going to return that value
52
00:02:14,656 --> 00:02:17,216
As part of the functions used right
53
00:02:17,472 --> 00:02:18,496
But again guys
54
00:02:18,752 --> 00:02:22,336
I don't think you're ever going to use a returned value
55
00:02:22,592 --> 00:02:26,688
In any of the functions we write or if we do it's probably once or twice
56
00:02:26,944 --> 00:02:28,736
So I don't worry too much about that
57
00:02:28,992 --> 00:02:32,320
So you need an hour's boiler is just how you start a function
58
00:02:32,576 --> 00:02:36,160
Just put void before every function at least for now
59
00:02:36,416 --> 00:02:38,720
What's the remove this debug.log here
60
00:02:39,232 --> 00:02:42,816
And also what I want to make sure you understand is
61
00:02:43,072 --> 00:02:45,376
Probably a good idea too
62
00:02:46,144 --> 00:02:48,704
Specify whether your functions are private
63
00:02:48,960 --> 00:02:49,472
Or pub
64
00:02:50,240 --> 00:02:52,032
Tesco Henry private here
65
00:02:53,312 --> 00:02:54,848
And then private here as well
66
00:02:55,872 --> 00:02:59,200
I'm just telling you this so that if you open up some scripts
67
00:02:59,968 --> 00:03:03,040
I must say you download an asset or you're making your game
68
00:03:03,552 --> 00:03:04,832
Can you see private
69
00:03:05,088 --> 00:03:06,112
In front of function
70
00:03:06,880 --> 00:03:07,904
Guys it's just like
71
00:03:08,160 --> 00:03:08,672
Terrible
72
00:03:09,184 --> 00:03:11,232
Functions behave in a very similar way
73
00:03:11,488 --> 00:03:13,536
You have to tell unity
74
00:03:14,048 --> 00:03:16,096
Whether the private or public mean
75
00:03:16,864 --> 00:03:18,656
Only this function
76
00:03:19,168 --> 00:03:21,472
Can be used inside the players
77
00:03:21,984 --> 00:03:24,288
I can actually access this function
78
00:03:25,312 --> 00:03:26,080
Inside
79
00:03:26,592 --> 00:03:27,360
Have another script
80
00:03:28,128 --> 00:03:29,920
Well the hurt function
81
00:03:30,432 --> 00:03:34,528
Don't mind I actually be a great example of a function that should be
82
00:03:35,296 --> 00:03:37,344
Because if an enemy touches the player
83
00:03:38,368 --> 00:03:39,648
I actually might want to
84
00:03:39,904 --> 00:03:40,672
Call
85
00:03:40,928 --> 00:03:42,464
Fire the function hurt
86
00:03:42,976 --> 00:03:43,744
In hurt the play
87
00:03:45,792 --> 00:03:47,328
Only ever make something public
88
00:03:48,096 --> 00:03:49,120
Do you have solution
89
00:03:49,632 --> 00:03:50,656
It needs to be used
90
00:03:51,168 --> 00:03:52,192
Across the game
5990
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.