I’m working on a soccer game and when a player charges their power up to kick a ball, it doesnt start from 0, it has a starting value, like 35
for example. The problem is that I don’t want my power bar to show that it starts from 35, I want to make my power bar look as if it was starting from zero. Here is my current code.
if input.UserInputType == Enum.UserInputType.MouseButton1 then
isMouseClicked = true
power = 35 -- This is my starting power
ToolController:setUsing(true)
ToolController:setCharging(true)
ToolController:enablePowerBar(true)
while isMouseClicked and ToolController:isCharging() do
power = math.min(power + 1, MAXIMUM_POWER)
ToolController:updatePowerBar(power/MAXIMUM_POWER) -- Update power bar, power/max power
task.wait(.025)
end
end
In this video, you can see how the power bar starts in the middle.