Line Trigger Actor
I'm working on a game involving lasers, and I'm designing it for mobile - so perhaps I'm worrying over-much about the optimization, but I'm having a couple issues regarding some detection.
Currently I have an "emitter" running a line trace to generate the laser. However, sometimes an object will move into the laser beam - and it should cut it off. Unless I'm running a line trace every tick (or every tick when the object is moving), I can't detect it. I mean, I don't know how heavy-duty a line trace is to run - I imagine not terribly, even for a mobile platform - but it'd definitely be easier if I could spawn some sort of "Line Trigger" actor (like box or sphere trigger) that could call an even onActorBeginOverlap. Does anything like this exist? I realize I could just make a really long and thin box or capsule trigger, but that's not quite what I'm looking for... perhaps I'm being overly picky.
Would love some input. Thanks!
If there is such thing as a line trigger, I would assume that it would need to do a collision test every frame, too. Under the hood all the collision is done with the PhysX framework. This includes overlapping (like the OnActorBeginOverlap), moving and checking for collision, the physic simulation and line traces. So I think there is no way around a collision test if you want to check when actors collide. The only "optimization" I can think of is to keep your line trace as short as possible.
answered May 07 '17 at 10:44 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here