Set boolean true with button press and check status

Hi everybody

So… I begin to feel very stupid.

All I try to do is:

  • Press F and set a variable to “true” - before pressing F it should be false. (done within Level Blueprint)
  • Check in another Blueprint (which is a car in my case, that is not the current player character) if the condition is true.

In the end, I just want to walk to a car, press F if overlaping and then change to the car.

Overlapping and then entering works. Separately, pressing F and entering works too. But pressing F and entering the car ONLY when overlapping, I couldn’t get to work.

But with my initial question, it would work. But I dont even know how to start. An Input F node with the “Set” boolean connected to the button pressed node doesn’t work. There even is a public boolean called “Condition” already present that I try to use.
Which would need to the next problem - I’m not able to make any other variable public (even with the eye activated). I also tried to make an array. But I’m even failing with that.

Hours later I’m really feeling stupid and would be glad for any help. And please consider when explaining - you are talking to a complete noob…

Thanks a ton!

pressing F and entering the car ONLY
when overlapping

How about this in the player blueprint:

  • the player has a collision sphere
  • when we press F, we check whether cars are overlapping it
  • if the first element in the returned array is valid, we can get in, there’s a car in the proximity
  • if the element is not valid, no car was detected

Things will get a bit more complicated if you overlap more than one car.

Thanks so much! That worked! I tried multiple different approaches - but didn’t know about the “is valid” node. You saved my weekend!

Thanks!

That’s the full blueprint now (just need to put the character into the car and stop animatuion, but that’s easy)