Skip to content
Snippets Groups Projects
Commit b93a826a authored by Akhmad Setiawan's avatar Akhmad Setiawan
Browse files

fix: max speed doubled

parent 54c6b601
Branches
Tags
1 merge request!5Fix/cheat
......@@ -22,7 +22,9 @@ namespace Nightmare
public override void RunCommand()
{
_playerMovement = _player.GetComponent<PlayerMovement>();
_playerMovement.speed *= 2;
// Double the speed but ensure it does not exceed 12
float doubledSpeed = _playerMovement.speed * 2;
_playerMovement.speed = Mathf.Min(doubledSpeed, 12f);
}
public static DoubleSpeed CreateCommand()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment