background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Создание android Игр на Unity Урок 7"

input logo icon
Video tags
|

Video tags

создание игр Unity
Игра На Unitу
создание андроид игры
игра на unity
Твоя Первая Игра На Unity
андроид игра
создание игры на андроид
создание игр на андроид
создание игр для новичков
создание игр на unity3d
создание игр на юнити
установка unity
мобильные игры
игра на ios
разработка игр на unity
геймер
GameDev
уроки по Unity
бесплатные уроки
Unity курс
курс по Unity
Unreal Engine 4
NECO
Unity tutorial
unity
gamedev
neco
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:02
today we have the seventh lesson on creating
00:00:04
games on unity,
00:00:05
today we will learn how to make our
00:00:07
player so that our player’s life is updated,
00:00:09
but we will set, for example, the
00:00:11
initial value of 100, for example, and
00:00:14
every time these
00:00:15
obstacles are removed someone takes away his
00:00:18
life, let it be like this 10 or 5 takes away
00:00:21
or each obstacle mine can be
00:00:23
taken away in different ways and so we
00:00:25
will do all this through a script so
00:00:26
today we will walk and you will see that
00:00:28
this is all, in principle, everything is very simple and not
00:00:31
worth it worry about this, but we’ll also
00:00:33
look at how you can add user
00:00:36
interface elements such as
00:00:38
text and so on into the 3d world so that, for
00:00:41
example, our text from the user interface
00:00:44
appears above our
00:00:45
player’s head, well, of course this player
00:00:48
doesn’t have any head, but just on top above the cube we
00:00:50
will have a text that will
00:00:52
move with it, in general, we will learn all this
00:00:54
in today’s video, so
00:00:56
watch until the end, subscribe, put
00:00:58
likes to support the channel, let’s start with the
00:01:10
very first thing to do this, we
00:01:12
will add a variable to our
00:01:15
player so that this variable and indicated
00:01:18
the amount of life of our player
00:01:21
this player, if you remember, there is a
00:01:22
squid player,
00:01:24
we called it if you don’t have this open, then
00:01:26
go from here assets
00:01:28
and select the script and here we have
00:01:31
player if we open let’s see
00:01:33
what there is basically nothing here,
00:01:35
just movement is good let's have
00:01:39
one more variable here, it will be private,
00:01:42
it will be and and let's call it
00:01:46
life shame no let's just live in let's
00:01:50
call it equal initially let it be 100
00:01:53
good and let's create a function
00:01:55
that will take away and of
00:01:58
course will show the standard of living of our
00:02:01
player let's call it public white abed life well, for
00:02:08
example, naturally you can
00:02:10
see as much as you want and everything, in principle, is
00:02:14
very similar to java and everything will be
00:02:16
indicated here too, we will now add int here this
00:02:20
will be the DPR why we did this, we
00:02:24
will request that the object
00:02:26
that will hit us he will
00:02:28
use this function and take away
00:02:30
our lives and the court will give how much
00:02:32
he takes away, that is, each object in this
00:02:34
way you can shoot differently if
00:02:36
you need to immediately subtract directly, well, for example,
00:02:39
subtract 10 to any object that
00:02:41
will hit once, which will have a script for itself
00:02:45
for removing life from us, that is, those
00:02:47
taking away life, he will constantly remove
00:02:50
the same amount, we want
00:02:52
each object to be taken away in different ways, we
00:02:55
will make the same function in the next lessons
00:02:57
for adding life, that is,
00:02:59
when we took some kind of this apple, we
00:03:02
will have a square naturally for now we are
00:03:04
adding life in this way
00:03:06
we will do everything so update live and
00:03:08
here we pass d match how much we will
00:03:10
take away
00:03:11
and how we will take away everything is
00:03:13
very simple as mathematicians write life
00:03:15
that is ours approximately light it ain't
00:03:17
data type in means there are integer numbers equal
00:03:19
to, or rather,
00:03:21
after life, here before equals we write
00:03:23
a minus, that is, we will remove and subtract
00:03:25
that naturally the demage is
00:03:27
all this way we subtract and let’s
00:03:30
immediately show how we took away on the console
00:03:33
so that it can be seen, but for now just for
00:03:34
print tests we will write q and life everyone
00:03:39
knows I don’t know if I pronounce
00:03:40
corinth life correctly and here is the plus sign Lois
00:03:44
that is, supplies we will update our life
00:03:47
under our variable we will indicate how much
00:03:49
life we ​​have now so what else do we
00:03:52
initially also show
00:03:53
print kontrol c
00:03:56
here is the start when it starts
00:03:58
game here we will show white point light
00:04:01
no start live start line
00:04:04
this will start and this could live
00:04:05
every time it seemed to hit an object
00:04:07
that will have a sketch which
00:04:09
application download the script that will
00:04:11
use the function it will take
00:04:13
our lives well let's save it and
00:04:15
see how everything goes it works, now
00:04:17
we will need to create another script,
00:04:20
this script will be applied to any
00:04:23
object that wants to take our
00:04:25
life, there will be this object, this
00:04:27
square that is hidden here, this
00:04:32
truth, of course, everyone will take it
00:04:35
differently, well, let's start, for example, with
00:04:38
So you can create a script right here here,
00:04:40
add it from
00:04:41
the components, or you can create a new one here in this
00:04:43
folder, hidden from here,
00:04:45
created a sysharp script, well select it and
00:04:48
call it d match enter everything is ready,
00:04:52
we have a clip so far it is empty
00:04:54
that this script will be do let's
00:04:56
see let's open the script here this script
00:04:59
will check for collision remember we
00:05:02
too I have already shown this and for this
00:05:06
you can add all this for now
00:05:07
and we will write on college enter what does this
00:05:10
mean this means that when our
00:05:13
collider
00:05:14
where it is here there is this
00:05:16
green, you see the green line, when
00:05:18
our collider collides with another
00:05:20
object, then this function will run, this is
00:05:23
when another object enters our
00:05:25
collider, when it comes out, there is
00:05:27
another function for us so far, they are
00:05:28
on you see anka lie down like this, I’ll write
00:05:34
on college in the all tear up such
00:05:38
a function and it passes to us the
00:05:39
college that contains itself and where is
00:05:42
the object that collided with us and there
00:05:44
is information about it anka lie exit this is
00:05:48
when it exits the collision but we do
00:05:51
n’t need it for now so we will
00:05:52
check here like this but this whole function
00:05:54
passes to us the college and in this college there is
00:05:57
information about the object that collided with us,
00:05:58
this will naturally be a
00:06:00
player because we have obstacles
00:06:02
and there is nothing else to the enemy, so we
00:06:04
take the college.
00:06:07
game object game object
00:06:10
will naturally be our player.
00:06:12
getcomponent and what kind of company do we need to
00:06:15
take we need to take the player script
00:06:17
correctly because in this script there is
00:06:19
this function that will take away here
00:06:22
we need we need to get to this
00:06:24
function but our player is taken away
00:06:26
using this function so we take
00:06:28
our getcomponent player function and All ;
00:06:36
and here let's create a variable
00:06:38
player player player script anyway, that
00:06:46
is, this is the script that we will take
00:06:48
mine with this variable and in
00:06:50
this approximately with the help of the variable we will already
00:06:52
change what we need the player is hidden.
00:06:54
update elite see everything this is our function
00:06:58
our function asks to enter here how much
00:07:01
we will take away I will write 10 everything you see
00:07:03
if you have many different collisions then you
00:07:05
will need to check here whether the
00:07:07
objects that collided with you have the script
00:07:10
player because I know that we are its
00:07:11
objects there is this is the only object
00:07:13
that can collide with my
00:07:14
player obstacles, but if there are
00:07:16
other objects, other players need to
00:07:18
check what kind of object collided,
00:07:20
whether it has started this script and this is an
00:07:23
error because if the object does not have a
00:07:25
crypto player this time, then it will not be able to do the
00:07:28
elite update is correct, but in my case
00:07:29
there is this: dial in this simple game
00:07:32
from one collision and we all subtract
00:07:35
10, and also if we subtract 10, then
00:07:37
this script which we add to different
00:07:39
objects will only be 10
00:07:40
mother, how can we do it so that it subtracts in
00:07:42
different ways and for this we
00:07:44
naturally add another separate variable,
00:07:47
we will write public so that you and I can
00:07:49
regulate and the
00:07:53
damage has long been
00:07:56
initially, well, let it be 5 and everything is like that and the
00:08:01
screw itself is all an integer is ready and we
00:08:03
will add it here, we will transfer the damage
00:08:05
now let's save and check everything,
00:08:07
add this script this script let's drag in
00:08:10
for our object this is what you can do with
00:08:12
your growth bring in this way all
00:08:13
your object and now there is a squid
00:08:15
dynamic so twice for some reason that's enough
00:08:17
let's delete once to delete one
00:08:19
script I take remove component all I
00:08:22
need is only one I don’t know why I
00:08:23
added two so good for you so far
00:08:26
only this rotating shelf will have
00:08:29
this script that will take away from
00:08:30
me what it will take away let’s
00:08:32
see the damage for now there is no need to
00:08:34
update so here I have updated in the player the
00:08:38
entire circuit has been updated for now I need
00:08:41
close so here indicates the error
00:08:42
correctly in this do not show anything
00:08:44
thereby two times and μs from the intent everything is like this
00:08:47
here we save normally
00:08:50
we return and look at everything you see here there is
00:08:52
smoke that is there I can
00:08:54
set how much this object will take away and
00:08:56
now if we go to to our club
00:08:58
we drag the damage script, you see
00:09:03
here the cube can take away, for example, 15
00:09:06
everything, now I select this stick, you see it
00:09:09
takes away 5 when
00:09:10
our player hits, and if we delete this
00:09:13
jacket, take away 15, save the scene as
00:09:16
always, counter c and let's check everything
00:09:19
for now, everything will be displayed in
00:09:21
the console here at the end we select clear
00:09:24
and let's check the launcher so
00:09:28
well, our player goes goes goes goes
00:09:30
watch start likes to wait wait wait for
00:09:33
him to be hit boom hit 9590
00:09:37
twice hit two 85 turned over almost
00:09:40
invisible boom boom now the cube hit him
00:09:43
15 takes away everything because we were left
00:09:46
alive 55 and we were reset in general, that is, you
00:09:49
see everything works fine,
00:09:50
okay, I hope that this is all clear, and
00:09:53
then what else can we do?
00:09:59
we take the college game object with the help of the college object
00:10:04
and this common game we take the component and we
00:10:07
know that the only object you can
00:10:08
encounter is the player, which means this
00:10:10
player our player has a squid player
00:10:12
we take we indicate the player that is our
00:10:14
script and in this script we already have we have a
00:10:16
bd-live function and we update our
00:10:20
life by taking away dimage a2 night in this case
00:10:23
50 is what we will install everything I hope it’s
00:10:25
clear now how to add this
00:10:28
text and told you above the head of our
00:10:30
cube we select our club player
00:10:32
take the right mouse button and go the way
00:10:35
usr interface and select canvas, we chose
00:10:39
it, you can’t see where it is, but it
00:10:40
appears in the same place where this canvas is old, that
00:10:44
is, it’s big, so huge that
00:10:46
you can see it near our cube. Well,
00:10:48
first of all, you need to point out that our
00:10:50
canvas render mod is not screen space then
00:10:53
there is not on the screen it will be where we will have
00:10:55
all sorts of controls and there are joysticks
00:10:57
but it will be inside the game world so we
00:11:00
select world space
00:11:01
everyone has chosen world space is ready and now
00:11:04
we can do like any other
00:11:06
object weighs it returns you see
00:11:09
to our cubes but it is too big,
00:11:12
you see a huge canvas, let's make
00:11:14
it according to the size, for this we need to make
00:11:16
rocks, let's first do x,
00:11:19
let's do 001 well,
00:11:22
all times exactly the same as the cube and y
00:11:26
too 001 0.01 that's all, but now forever
00:11:31
inside the cube, let's raise it a little higher like
00:11:34
this let's analyze it, rotate it
00:11:37
90 degrees, it contains 27 elements of the
00:11:40
usb interface, that is, the user
00:11:43
interface in this case, we don't
00:11:45
use
00:11:46
the interface, we just use them for
00:11:47
our needs and we need text, this is an element
00:11:50
that will be inside the canvas, and so we take it
00:11:53
and expand it, we will have it along the y axis
00:11:56
it seems 90 to everything is fine and
00:11:58
now we drag it into this canvas, that
00:12:01
is, we create
00:12:02
text inside the person, the text
00:12:05
sausage appears and so we will also reduce the text,
00:12:07
let's do something, let the width
00:12:12
be 100, everything is fine, but the text is almost
00:12:16
invisible because he needs to choose
00:12:18
a color, let's choose another color, here he is
00:12:20
here, time he's here and now they have
00:12:23
white white to embed me in, but
00:12:25
some other text is blurry, we do
00:12:28
n't like this one, let's select canvas
00:12:29
and here you see dynamic pixels per unit,
00:12:33
let's choose on for example 5 you see
00:12:36
the text is already clear,
00:12:38
okay now what we do is select the
00:12:40
text and make sure that the text is in the
00:12:43
center, select in the center everything is fine, but the
00:12:46
same will suit us here too in the
00:12:48
center and what will we write in the text
00:12:51
for now let’s write 100 or just let
00:12:55
's write zero okay this text that
00:12:59
will show how much life we ​​have it
00:13:01
will be taken away okay now what do
00:13:04
we do next now we need to go to
00:13:06
our script of our player
00:13:08
so here it is player and here we will
00:13:11
update well what will we update we
00:13:14
will update the text that's right, so
00:13:16
we need to create a variable, we can
00:13:19
do it in two ways, the first way is
00:13:20
here, start nike, our text is based on its
00:13:24
name,
00:13:25
that is, we can give it our name,
00:13:27
for now it's just a text called we
00:13:29
can call it whatever we want, it's like
00:13:31
its identifier and that's why name,
00:13:33
as in previous videos, I showed
00:13:35
using fine to find it, assign it to a
00:13:38
variable and use this variable
00:13:39
to update the text, but you can do it
00:13:42
differently, as I showed you, we can
00:13:44
make this variable public and this
00:13:47
way we can simply drag an
00:13:50
object with screen
00:13:52
now I will show you all the text I indicate and
00:13:55
let it be life state all livestreet
00:14:01
this is our text after all and it does not stretch
00:14:03
we are in the lead but no matter mine let’s drag it
00:14:05
so it will be assigned now I
00:14:08
will show you everything here we are writing our
00:14:10
apology life life state.
00:14:14
it has a parameter text equals and here
00:14:18
we write whatever we want, but naturally we
00:14:19
will not write everything a life, that
00:14:22
is, how much life we ​​have, but this is int
00:14:26
and we accept text, that is, string,
00:14:28
how to turn
00:14:29
in the string will simply decide. that string,
00:14:33
open all two brackets, close them, and that’s
00:14:37
it.
00:14:38
Now everything will be updated,
00:14:40
but for now naturally
00:14:41
nothing will work, why but because our text
00:14:44
is cash, that is, it doesn’t exist, we have
00:14:47
n’t added anything to it yet, how can we fix this? It’s
00:14:49
very easy to select our player of our century
00:14:52
and it has a script where is our
00:14:54
script here it is player you see the script here
00:14:58
it is the player script and here you see the life
00:15:00
state asks us to enter text here a
00:15:04
text field that where we want to
00:15:07
show so I just take it
00:15:08
here in the canvas
00:15:09
my text is this one and drag it so
00:15:12
sorry I chose it like this player here it is
00:15:15
here, we don’t take the text and drag it
00:15:17
here you see everything boom added everything
00:15:20
now we already have an assignment and we did
00:15:22
n’t have to write it in the code, that
00:15:24
is, this text is no longer empty and
00:15:26
that is, the text from the screen I’m giving it
00:15:28
from here from here you see, I brought it
00:15:30
all now if I’m for it and I haven’t seen it yet,
00:15:33
one thing is that it needs to be initially
00:15:35
updated at startup in the same way of
00:15:38
design and here the start so that it’s not 0
00:15:42
immediately shows how much there is
00:15:44
initially,
00:15:45
I save it and now we launch everything and
00:15:49
look at everything because initially 100 are watching
00:15:53
our players, so I can move him,
00:15:55
what will happen when he gets hit
00:15:58
will be 95 hit once so far boom
00:16:03
80 65 house 50 you see everything is very simple
00:16:07
and not with such examples you will learn
00:16:09
to create more complex games
00:16:12
by understanding the code, understanding how to work
00:16:15
add elements how to use this way
00:16:18
but that's all for today I
00:16:19
hope you liked it I hope
00:16:20
everything is clear to you to keep the channel
00:16:23
write something in the comments like
00:16:25
subscribe there are more
00:16:27
subscribed and see you the real video
00:16:29
bye everyone
00:16:40
[music]

Description:

На этом уроке по созданию мобильных игр на Unity для операционной системы Android мы будем учиться писать код для отнимания жизни у нашего игрока. Пишем код на языке программирования C#, этот язык очень похож на Java так что не стоит переживать. Если хочешь поддержать канал ставь палец вверх и пиши комментарии, ну а если еще не подписан то подписывайся! ★ ★ ★ ★ ★ ★ ▼Соц.сети и WEB▼★ ★ ★ ★ ★ ★ ★ ►Instagram: https://www.facebook.com/unsupportedbrowser ►Моя веб страница: https://neco-desarrollo.es/ ►VK: htpps://vk.com/public189519480 ►Телеграм: https://t.me/androidstudioneco ★ ★ ★ ★ ★ ★ ▼Первые уроки▼★ ★ ★ ★ ★ ★ ★ ►Скачать Unity здесь:https://unity.com/es/get-unity/download ►Вступление: https://www.youtube.com/watch?v=tZz8IhrleCA ►Урок 1: https://www.youtube.com/watch?v=kMpH8-heAVk ►Урок 2: https://www.youtube.com/watch?v=OhKo32SnYHQ ►Урок 3: https://www.youtube.com/watch?v=vROyQtdUUAo ►Урок 4: https://www.youtube.com/watch?v=r69h5P-NILQ ►Урок 5: https://www.youtube.com/watch?v=-GYKJmL5rE0 ►Урок 6: https://www.youtube.com/watch?v=baED3GHrnPw ★ ★ ★ ★ ★ ★ ▼Поддержка канала▼★ ★ ★ ★ ★ ★ ★ ►Поддержать канал донатом можно здесь: https://www.paypal.com/donate/ ►Поддержать на Патреоне:https://www.patreon.com/join/neco_desarrollo

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Создание android Игр на Unity Урок 7" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Создание android Игр на Unity Урок 7" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Создание android Игр на Unity Урок 7" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Создание android Игр на Unity Урок 7" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Создание android Игр на Unity Урок 7"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Создание android Игр на Unity Урок 7"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.