How to make a power bar start and then stop by pressing the space bar

Hi guys,

Like the other question I asked.. As part of our group project we are creating a 3d golf game. We currently have a power bar that moves constantly, but doesn't stop or start upon hitting of a key. Would anyone be able to show us how we are to stop and start this with the pressing of a key.

Regards

Your best bet is to use Input.GetButton and have it increment a powerLevel variable in your update function. See the docs for usage details. Also, GetButtonDown and GetButtonUp will be useful here.