Question by
Seabass1609 · Jun 01 at 12:03 AM ·
error
my speed float will not devide
Hi, I'm making a top down shooter game and noticed a bug, when you strafe and walk forward at the same time, you go twice as fast, so I tried to fix it by when you strafe and move forward at the same time. your movement speed gets divided by 2. when I try that with this code: if (Input.GetKey(KeyCode.W)) { if (Input.GetKeyDown(KeyCode.A)) { (movmentSpeed / 2); } } it gives me this error: Assets\Scripts\Player.cs(54,17): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement please if anyone could help I would be very grateful. Thanks.
Comment