I am making a racing game. I made a simple track and created a StartLine as well as some checkpoints, so that I know the player did make a lap through the track and didn’t just do shortcuts.
The plan is that the Checkpoint have some Boolean “HasBeenActivated” variable, so that only the first time in a lap the player goes through it counts it. Then the plan is for once you hit the star line again with all the checkpoints passed then we count one lap, save the time, reset the checkpoint passed counter and reset the “HasBeenActivated” variable for the checkpoints so that we can check again if the player passed through all checkpoints.
The problem is that I am not able to reset out the “HasBeenActivated” variable. So when the player goes on the next lap, it doesn’t count up when you cross checkpoints. I created a variable in the StartLine blueprint of the class “BP_InvisCheckpoint_C”, and I even set the HasBeenActivated variable as visible in the BP_InvisCheckpoint blueprint. I don’t know what’s going on.
Looking at the top BP, I dont see any loop that goes over every checkpoints and resets their state. The variable Invis_checkpoint_c, it should be an array of checkpoints and you need to go through each of them, resetting their ‘Si Activated’ property, don’t you think?
So What I would do is make Invis_Checkpoint variable to an array of type Invis_Checkpoint_C and make it public. Once i place the startline in the map, I would go over each checkpoint instance in the map and add them to this array.
I’m trying this, but when I convert the variable to array, I can’t access the ‘HasBeenActivated’ variable from within. There is the GET function but I am not sure how to use that. If you can make a picture for me, I’d appreciate it.