I am trying to have two independent “laser pointer” style beams following my controllers when in VR.
The problem in short: I want the beams to work independent (moving with the controllers and switching on/off using “set active” with true or false), but at the same time I do not want any computations to run in the background while the beams are off (to save resources). The trouble starts with the “tick event”.
The basic set-up is working (particle systems, line trace from the motion controllers, switching on/off ). Using a “tick event” I can get the beams to move with the controllers (“get hand position and orientation”). Without a “tick event” the beams are created once in the correct place (the current position of the motion controller), but then they stay in that place and don’t move with the controller any more. This is true both when I have the related particle system component added to the controller component and when the particle system component is simply attached to the DefaultSceneRoot, on the same hierarchy level as the controllers.
Now the problem is this: In order to avoid the “tick event” firing into any nodes when the beams are off I placed a “gate” in to the stream that opens up for the “tick event” when the first beam is set active and closes again when it is deactivated. Since I can only have one “tick event” in a blueprint (as far as I know) I end up wiring the exec output of last note from the first beam into the first node for the second beam to get that one following my controller. In consequence the second beam only works when the first beam is active.
Is there a more clever way to get the beams to follow my controllers that avoids using a “tick event”? That would solve the whole issue.
Please let me know if I should provide more information. Looking forward to your help.