Тёмный

Unity C# - Fade out GameObject when player is behind it. 

Подписаться
Просмотров 17 тыс.
% 342

In this video, I will show you how to make an object fade out when the player goes behind it to make sure the player is always visible.
Make a game like Zelda: www.udemy.com/course/unity-beginner-level-game-from-start-to-finish/
Learn Python Complete Beginner: www.udemy.com/course/python-for-complete-beginner/

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

 

21 фев 2023

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@ianfavreau9776
@ianfavreau9776 8 месяцев назад
Thank you so much for this tutorial. You saved me literal hours.
@Salvadorioo
@Salvadorioo 2 месяца назад
Находка года. Это оно! Это то, что я, черт побери, хотел найти но не знал как
@laniakeadev.2271
@laniakeadev.2271 18 дней назад
На самом деле очень спорное решение.
@fakezii4516
@fakezii4516 Год назад
Very helpful video, but I modified the script to use Physics.RaycastAll instead of a normal Raycast to check if multiple objects are blocking LOS between the cam and player. For example if you're making an isometric game then it may be useful to have since more than one object can obscure a line of sight, for example a wall and another object inside the room. Other than that you pretty much saved my project so thanks a lot
@alexandreorsat805
@alexandreorsat805 3 месяца назад
i'm making an iso game also but i dont know how to use the raycast all. Can you help me a bit pls ?
@fakezii4516
@fakezii4516 3 месяца назад
@@alexandreorsat805 it’ll be the same implementation as raycast IIRC but you should probably read Unity’s scripting API manual or watch some other videos about it
@Focto
@Focto Месяц назад
Can u share the code bro, i already did it but it wont back to normal again when player leave the wall
Год назад
How to make it for prefab of tree or something?
@beanieguy5313
@beanieguy5313 11 месяцев назад
thankyou!
@DerpyPlayz429
@DerpyPlayz429 Месяц назад
Hello! I was wondering if you could have this same thing but make a trigger so when you walk through a door or something then an object around you disappears? (Its for my horror game)
@hiddenvinnyp
@hiddenvinnyp 10 месяцев назад
What if there are 10 trees on the scene, and all of them have the same material. How to make disappear the only one tree?
@thisisspac
@thisisspac 8 месяцев назад
Hi, you can Get the meshrenderer for target tree and change the sharedMaterial. GetComponent.sharedMaterial = newMaterial; New material will be your low alpha material.
@vasiliysmirnov3922
@vasiliysmirnov3922 3 месяца назад
Is it rly the way to go? Check every frame for all this stuff and then for every GO lerping alpha. Looks like very consuming practice for cpu..
@SmokingBeard
@SmokingBeard Год назад
Loved the video, but the screams killed me.
Год назад
Doesn`t work :( Can you upload the project?
@sebaferrari_tattoo
@sebaferrari_tattoo Год назад
Esto solo funciona si la textura es un color al parecer... por que con una imagen no funciona
@random_precision_software
@random_precision_software Год назад
good helpful video..BUT its bad practise to find the player with FindGameObjectWithTag in the Update !!!
@OnlineCodeCoaching
@OnlineCodeCoaching Год назад
100% agreed. I hope everyone sees this comment.
@haibu128
@haibu128 Год назад
Why is that so?
@haibu128
@haibu128 Год назад
And what is an alternative?
@OnlineCodeCoaching
@OnlineCodeCoaching Год назад
@@haibu128 Just call the indGameObjectWithTag in the start function instead of the update.
@OnlineCodeCoaching
@OnlineCodeCoaching Год назад
@@haibu128 OR make a function for when to set the player reference when the player joins the game.
@charm558
@charm558 Год назад
ty