Stop car from driving when an integer value reaches 0


I just recently started working on a fuel system and I thought it would be quick and easy to do. I set up the depleting part of the fuel system but, when the fuel integer value reaches 0 I want the player to not be able to move the car. Here is my set up:

Is your setup working? It should be, from the looks of it. Make sure your fuel default value is not 0.

Yes, everything works. The fuel value is set to 100. Would it have anything to do with the fact that it’s not the default vehicle template? I added this vehicle to a third person template project. Is there a way to disable input but, only from moving the sedan and from nothing else?

1 Like

Still looking to fix this :stuck_out_tongue:

I think you should set throttle input to 0 when the vehicle runs out of fuel.

I tried it but, the vehicle still moves when it runs out of fuel.

You can check in Event Tick if the vehicle has fuel if it doesn’t you can set Handbrake Input to true.

My bad, I just realized I was setting throttle input to 9 instead of 0 lol. It’s working now. Thanks.