okay well hello there guys, So i’m working on a system that would allow a player to purchase a door to open it, kinda like cod black ops zombie mode, where you have to pay to open doors.
However the catch is, The player should be able to open and close doors multiple times with only paying once!
The way i have it set up, when you press e
-It traces to see if you hit a door
-If a door is what you hit,than it checks if you have your money variable is above 500$
-if true, it subtracts the money from your money variable
-Then it Tells the door blueprint to play the door open animation.
The only problem with this is, everytime you look at a door, and press e, even if you’ve already bought that door, your money will still be subtracted.
In an attempt to make it that you only have to purchase the door once, i set a variable to true once you have purchased the door, so that all future times, it checks that variable if the door has been purchased, and skips the money subtraction, and just opens up the door.
However, this variable effects every single door in my game, so if you buy one door, it sets the variable to true, and then every other door is costs nothing! Which is not what i want either.
What I’m thinking is to set, a variable in the Doors blueprint to check if that specific door has been purchased. then send that information back to the character blueprint…But I’ don’t know how to do this. My mind is hurting from trying to think of how this is supposed to be accomplished.
So, how could i make it so when you purchase the door, it only has to be purchased once, and then all future times it knows it has been purchased, so that when e is pressed, just go straight to opening the door.