Тёмный

Unity 2D Platformer Tutorial 18 - Making the camera follow the player 

Daniel Wood
Подписаться 20 тыс.
Просмотров 25 тыс.
50% 1

This video demonstrates how to write a script to make the camera follow the player in a 2D platformer game in Unity.
Code for this tutorial - github.com/danielkwood/Unity2...
Unity website - unity.com
GitHub - github.com/danielkwood/Unity2...
Free Pixel Space Platform Pack - assetstore.unity.com/packages...

Хобби

Опубликовано:

 

8 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@Borisisheretohelp
@Borisisheretohelp 2 года назад
Great video. You explain the code perfectly to me.
@nickwalczak1288
@nickwalczak1288 2 года назад
Solid video my man, thank you.
@choppapeters9068
@choppapeters9068 Год назад
best tutorials on the internet by far!!!!!
@HienLe-lf2xc
@HienLe-lf2xc 5 месяцев назад
Thank you, Daniel!
@rd6ft7ghu9ji0k
@rd6ft7ghu9ji0k Год назад
you are a game saver! thank you soooo much!
@alexanderpfeif2937
@alexanderpfeif2937 Год назад
and a game changer
@erenmisirci739
@erenmisirci739 Год назад
Guys if camera shaking fix the first line of code it should be "playerPosition = new Vector3(player.transform.position.x, player.transform.position.y, transform.position.z);"
@darth-tyranus8098
@darth-tyranus8098 Год назад
Thansk you video was reeally helpfull
@poggle_Galaxy
@poggle_Galaxy Год назад
If the Camera is shaking like crazy, Change Update to FixedUpdate
@benioqu5448
@benioqu5448 2 года назад
Thank you!
@Davidpander
@Davidpander Год назад
Thank you!!
@InfinXgtag
@InfinXgtag 2 года назад
Thak you!
@PedroMunzone
@PedroMunzone 2 года назад
i need to know when player dies the camera follows the player to the spawn point
@darth-tyranus8098
@darth-tyranus8098 Год назад
Thanks
@isacic140
@isacic140 2 года назад
thx for the videro
@brosthestickmandude
@brosthestickmandude 2 года назад
for some reason it's not working the camera is just shaking like crazy :( maybe just my mistake idk
@desperbamboo
@desperbamboo 2 года назад
why cant i just do Vector3 instead of new Vector3
@richardrae5254
@richardrae5254 Год назад
why not use Cinemachine?
@blablu2475
@blablu2475 2 года назад
it's woking but shaking when moving. position.y not following!
@tommedenney
@tommedenney Год назад
im having the same issue -- any way to make it follow x and y axis
@realpiee
@realpiee 2 года назад
how do I make it not update Z?
@Enderia2
@Enderia2 Год назад
It doesnt update z by default, as he put transform.position.z, not player.transform.position.z, so yeah.
@schonzzuritv3010
@schonzzuritv3010 4 месяца назад
its a 2d game. you dont need Z
@HonkChamp
@HonkChamp Год назад
Instead of your solution for the smooth camera, I tried this instead: camDist = player.transform.position.x - transform.position.x; transform.position = new Vector3(transform.position.x + (camDist / 1000), transform.position.y, transform.position.z); Basically, this moves your camera 1/1000 closer to the player each frame. This creates a smooth, simple (and customizable) camera movement system. You can always multiply by 0.001 to make this even more efficient
@ishwarsinghchauhan8060
@ishwarsinghchauhan8060 Год назад
or if I just put camera under player folder?
Далее
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Просмотров 1 млн
Теперь мы - музыканты!
00:46
Просмотров 50 тыс.
WHAT ARE "TIGHT" CONTROLS? - Movement in Games
9:14
Просмотров 346 тыс.
Making CLEAR Ice [SOLVED]
11:31
Просмотров 3,3 млн
Watch This Before You Make Your First Game!
14:35
Просмотров 318 тыс.
МОЩЩЩНОСТЬ ZEEKR 001 FR
0:46
Просмотров 2,6 млн
#Котлеты и отбивные
1:00
Просмотров 2 млн
#Котлеты и отбивные
1:00
Просмотров 2 млн
ЛЕТНИЕ КОСТЮМЫ 😍
0:38
Просмотров 1,3 млн