Reputation: 31
I'm programming a boss fight in unity, and am currently testing how well the boss bar works. With the way I have written my code, it means every time I test it, I have to run the entire boss fight. Is there a way to speed up the run mode so I can get through it faster?
Upvotes: 1
Views: 735
Reputation: 12336
It's a good question, there's no really good way to do that.
Part of working on games is, you need to build-in "development logic" that will let you "automatically win" battles and so on for exactly this reason.
It's actually a huge fairly major part of making games!
It's extremely hard to "test" these things without "actually testing" them!
Upvotes: 1
Reputation: 149
You could create triggers for when you want something to happen or change a condition
public bool TestMode;
void Update(){
#region Tests
if(TestMode){
if (Input.GetKeyDown("a"))
{
bossLife -= 10;
}
if (Input.GetKeyDown("b"))
{
bossIsEnraged = true;
}
if (Input.GetKeyDown("c"))
{
bossIsDead = true;
}
}
#endregion
}
Upvotes: 0
Reputation: 333
You can try adjusting Time.timescale higher than one, this will accelerate your game.
https://docs.unity3d.com/ScriptReference/Time-timeScale.html https://answers.unity.com/questions/239552/accelerating-time-dramatically.html
Upvotes: 1