Тёмный

Unity: How to Regenerate Values (like Health) over time 

Feed My Kids
Подписаться 721
Просмотров 62
50% 1

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

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 3   
@Droppa1
@Droppa1 15 дней назад
wb
@Droppa1
@Droppa1 15 дней назад
Health.cs you shouldn't use Time.time to control RegenCanStart. If you do then when you pause the game in the editor, or hit a breakpoint, or even save the game the timer is still going and when you come back regen will start. Rather in OnTakeDamage *set* startRegenTime to timeBetweenDamageAndRegen, then in Update, subtract Time.deltaTime from startRegenTime as long as it's > 0.
@FeedMyKids1
@FeedMyKids1 10 дней назад
Incorrect: Pausing the game (timescale 0) doesn't affect it. Pausing the Game tab from the editor doesn't affect it. Pausing using Debug.Break doesn't affect it. Saving does not affect it. Save a value like "TimeUntilRegenStarts" (value = startRegenTime - Time.time) and upon load do "startRegenTime = Time.time + TimeUntilRegenStarts"
Далее
I Made the Same Game in 8 Engines
12:34
Просмотров 4,2 млн
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 722 тыс.
ŠKODA не перестает удивлять
00:48
Просмотров 613 тыс.
진 (Jin) 'I'll Be There' Official MV
03:15
Просмотров 8 млн
А вы знали что металл тонет?
00:32
Building a Tiny Office Pod Under My Stairs
51:47
Просмотров 6 млн
Pathfinding & Moving NPCS • Roblox Studio Tutorial
14:55
How I Became a Sea of Thieves Developer
8:05
Просмотров 268 тыс.
I Solved The World's Hardest Maze (with Code)
9:54
Просмотров 180 тыс.
I Optimised My Game Engine Up To 12000 FPS
11:58
Просмотров 704 тыс.
12 Tips to Boost Your Godot Game's Performance
11:27
Просмотров 3,3 тыс.
Everything You MISSED about UNITY 6 (Unite 2024 Recap)
16:14
How to Make NPCs/AI Run Away (with examples in Unity)
24:14