Set actor hidden in game not working on event Tick and Input Action.

Hi. Little problem hire. Problem is that function doen’t work on Tick and InputAction in one time but other actions. If I turn of one of them it works fine. First “Set actor hidden in game” is called when object is to far from camera (character), secound is called when first (when camera is near and if object is visible) is false and right mouse button click “input action” (and it doesn’t work). Any sudestions?

Hi, what’s happening is the tick function is firing every rendered frame so your input action results with something like this:
tick update -> check distance to player -> set hidden or not hidden -> input action update -> set object to hidden -> tick update -> check distance to player -> set hidden or not hidden -> etc…
So basically the tick event is overriding your input event.

For now, you can try adding a bool variable to your BP_Row and set that true/false with the input event.
This is how I’ve opted to put it together.

I can help further if you describe what your goal is for this interaction.

edit: I suppose the true line after the clicked? branch can be disconnected, because the inputAction already marks the actor hidden.

Unfortunetly it works the same like my example.
Gues that is problem with remember that object is hidden, and like you wrote Tick assign my InputAxis, I don’t have idea what Event use to fix that.Meybe construct my self event?

Goal is construct object (BP_Row) who wil have 2 functionalities.

  1. Hide when camera is out of range (Range).
  2. Hide when right mouse button click on object.

I got it. It wirks with. Now just construct some switch to remember on/off and that will be all.

THX :slight_smile:

I’ve just realized I used a lessThan rather than a greatherThan in my last comment. Sorry about that.
I’ve also added changing collision detection when toggling hidden. I don’t know if this is something you might need, but testing against a cube in my scene seems to fix a collision issue I had when shooting already hidden rows.