Changing value of bool for one certain object

Hi there,

absolute newbie here that is just getting into the whole UE5 blueprints thing. As said in the header, I’m trying to find a way to re set a bool value for one specific object (locally, not globally).

This is for a grappling hook mechanic (I got from YouTube) where the player is able to grapple on every single object within reach. Now I was trying to see if I could get it to fire only at certain objects that are deemed “grappable” by a bool. The shooting mechanic with the grappable bool seems to work, now I have to find a way to set the bool to “true” without changing it globally and really have no idea how.

Any feedback is greatly appreciated!
Happy sunday :slight_smile:

You could create a bool inside your “grappable object” Bp (isGrappaple? for example), set it to be exposed to the editor by checking the eye icon next to the variable. As you spawn instances of your object inside the level, you can set the variable to whatever you want for every instance of the object that you’ve placed.

To clarify even more, a BP stores the default values of the variables within it, if the variables are exposed to the editor, each instance of that object placed in the level can have it’s own set of values without altering the original Bp.

For example, I have set up this simple bp consisting of a cube and declared this variable (default is false) within it:
image
The eye makes your variable public and editable on the object’s instances.

I’ve also made my character print Hello when it overlaps a cube that has the CanFireEvent? variable set to true like so:

Now, I’ve placed three instances of my Cube Bp in the world:


If you click on one of them and look into the details panel to your right, you’ll see that you can edit the bool variable:
image
For example, I’ll only set the middle cube to be able to fire events by setting the bool to true.
This is what happens:
ggg

Hey there, thanks a lot for your feedback, it really helped me realizing what I was missing!