Booleans

I had a go at the ‘Running out of Ammo’ part before watching the actual video, and this is the solution I came up with. Essentially the same as shown in the video, just the other way around. I have also created a Variable called ammoIsEmpty of type Boolean and am setting this to true when the ammo variable is <= 0, I have done this so I can use it in the future to add an ammo pickup that will only allow it to be picked up if ammoIsEmpty == True. ( I havent watched passed the Boolean video yet so not sure if this is covered or not yet. Is there anything about the way I have set this up that could be potentially problematic further down the line? Thanks

I don’t see any possible drawbacks of this approach.
One thing you could do to verify that “Ammo Is Empty” variable starts it life with its value being equal to False

Not coming from a programming background, but from the blueprint representation it looks like you’re resetting the ammoIsEmpty variable every time if Space Bar is pressed with no ammo left. Probably shouldn’t impact much, but just wondering if it could cause a slow down if the action was performed in a very quick succession multiple times.

Privacy & Terms