|
Hey. I want the player to be able to toggle if he should fly or be grounded. So when(for example) the player presses "f" then he can fly and when he presses it again he stops. How would I put that in a simple line of code ?
(comments are locked)
|
|
Which script are you currently using? I've modded the FPSWalker script of days gone by to turn gravity off, if that's any clue. Look in your code where gravity is applied. Make a 'flying' var (boolean) that when it's 'true' you don't apply gravity. And have Update look for the 'f' key to toggle that 'flying' boolean. Edited to show code how user can toggle it.
Mar 22 '12 at 01:39 AM
DaveA
(comments are locked)
|
