ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Simple Way To Add Hit Blink Feature To Your 2D Game Made With Unity Software

alexander zotov

unity tutorial

unity

game development

unity game

make unity game

unity 2d

unity 3d

Автор: Alexander Zotov

Загружено: 2021-07-27

Просмотров: 7158

Описание: #unitytutorial #hitblink #hitdetect

I play games here -   / zzotoff  
You are very welcome :-)

Hi! In this video I show you a simple way to create this hit blinking feature when a player gets some damage.
I start from an empty project as usual. First I add the player to the scene. Second I add this white blink image which replicates the shape of the player. I make this blink object to be a child of the player. Players' order in layer is zero by default as well as blinks one. So I set blinks order in layer to 1 so it appears above the player. Move the player to the right a bit and add a component which is a box collider 2d to detect collisions. Set it as a trigger and edit it like so. Also I add a rigid body 2d because one of the colliding objects should have it attached otherwise a collision will not be detected. Set the gravity scale to zero so the player will not fall down. Next I add the sword to the scene. Position it about here. Set order in layer to 2 so the sword appears above the blink. Sword needs a collider as well. Set it as a trigger and edit it a bit.
Ok. Sword will have a script attached. This is quite a simple one that allows me to move the sword with left and right arrow keys. Here it is. Script goes to the sword game object. The player will also have a script. Here it is. This script allows me to control that blink game object. Serialize field attribute helps me to initialize it in the inspector. In Start method I disable it so blink is invisible initially. OnTrigger enter 2d method is invoked when player collides with the sword. When it happens I invoke two methods. First one enables the blink and the second one disables it in 0.1 second so I have that blinking feature. Pretty simple. Script goes to player. Select player and D&D blink game object into corresponding slot of player script so player game object could control it. Hit play and see how it works. Beautiful. You can download this project by the link in the description but only if you give a like to this video first. Thanks for watching. See you next time.

Project files here https://drive.google.com/file/d/1SntE...

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Simple Way To Add Hit Blink Feature To Your 2D Game Made With Unity Software

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Secret Password To Continue Playing A Level You Want Feature For Your Game Made With Unity Software

Secret Password To Continue Playing A Level You Want Feature For Your Game Made With Unity Software

How to Add MUSIC and SOUND EFFECTS to a Game in Unity | Unity 2D Platformer Tutorial #16

How to Add MUSIC and SOUND EFFECTS to a Game in Unity | Unity 2D Platformer Tutorial #16

Simple DASH Mechanic in Unity

Simple DASH Mechanic in Unity

Похудей на 45 КГ, Выиграй $250,000!

Похудей на 45 КГ, Выиграй $250,000!

The right way to pause a game in Unity

The right way to pause a game in Unity

A Great Way To Setup POWERUPS In Your Unity Game

A Great Way To Setup POWERUPS In Your Unity Game

Blinking Animation in Unity 2D - Easy Tutorial

Blinking Animation in Unity 2D - Easy Tutorial

Tutorial How To Make Simple Digital Code Lock With Display And Keypad For 2D Unity Game

Tutorial How To Make Simple Digital Code Lock With Display And Keypad For 2D Unity Game

How To Add Sound Effects the RIGHT Way | Unity Tutorial

How To Add Sound Effects the RIGHT Way | Unity Tutorial

Creating SMART enemies from scratch! | Devlog

Creating SMART enemies from scratch! | Devlog

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]