so I’m currently working on a laser system, that checks, if certain actors are in its way using the “Is Overlapping Component” node. One of the actors is a Moveable Object, that can be replaced during runtime. If it it overlapps, the laser should disappear but if it doesn’t, it stays visible.
Now that worked well for a while and I did some additional logic afterwards that didn’t work well, so I deleted the additional part. But then… it was broken. What worked before doesn’t work anymore, though the inital part has stayed exactly and 100% the same (checked it 100 times).
To find the error I replaced the following actions (setting the lasers visibility) with print string, like on the screen below. Not if the moveable actor isn’t overlapping, it works fine. But once it does, I get both TRUE and FALSE.
this is a 3 way of doing the overlap event. nvm the sequence…
if you only want to check for 1 type of actor you can use the method from then 0 on sequence and set the class filter to that bp.
if you want more then one you can take the method from then1 or the “On component begin overlap” and cast to the different actor types you want the laser to react to.
forgot to take the other actor to object on bp-explosion2 so you would have to do that.
I mean it sounds like either you are spawning and removing the object that it’s supposed to check for… or that you got another actor that is checking the same object and spamming yes while your other actor is spamming no?
pretty hard for me to understand what is going on unless you reveal a larger portion of what you are doing and what’s going on in the level
There’s a Laser, that does only work if its starting point does not overlap the “Moveable Actor”.
There’s a “Moveable Actor”, that can be replaced by the player. There are multiple instances of it in the map, though the error also occurs if only one instance has been placed.
So the setting is: if the player places the “Moveable Actor” at the starting Point of the Laser, it will be disabled. If it’s removed or hasn’t been there in the first place, the Laser is enabled.
Okay so I’ve tried many things and this seems to work… at least so far. I’m not completely sure myself, why exactly this solution does work but it does and it does either output TRUE or FALSE.
PS: The “Is Overlapping Component” isn’t needed, if you only care about the main actor(s). It but only specifies a component to check with (good for actors with a huge trigger volume around them for instance).
So there is only one laser on the map? ohh right… yeah the reason for why you get both true and false is because your script checks all the boxes on the map per tick… so if you got 3 boxes and you place 1 infront of the laser then 1 will be true and the remaining 2 will be false. You understand?
That’s why you should use one of the methods I sent you instead of the old method because my method checks what is overlapping the laser while your method checks if any of the boxes on the map is overlapping the laser…
in other words if you got one function that says if false then it should be active and if true it should be inactive it will generally be both false and true all the time since you got more then 1 box…
But all this aside… if you are using a particle emitter (beam) for the laser you can use laser start as a starting point.
Set the distance as a Parameter (in this example it’s called range.)
Hey thanks for the hint, I also thought about a tracing… I might implement it later, though there are a lot of very difficult actors to take into consideration. Perhaps I’ll make a hybrid system later on.