I m having a really obscure issue. I set up a system to have a laser beam coming out of my motion controller vive by pressing the right trigger. When I lanched the Vr preview the laser would work approximately 50% of the time. I attached a point light where the laser collide with an object. The point light is always working and visible when I press the trigger. The code behind the laser (which trigger an action on different actor blueprint) is always working, but the visual laser works randomly. I lanch the editor and it will work, then launch it again and won’t work. Sometimes after pressing it 10times it will work and sometimes after trying to press 100 times it will still not work. This is unlogical to me. I don’t know if someone went through this kind of issue already.
[Edit: We found the solution for the issue, was due to the variable booleen. But I have still an issue of the beam being laggy, there is a delay when I move the controllers, the beam follow it up with a small delay, any clue from where it could come? Maybe due to the event tick? ]
So I set up the variable Enable Beam Right Hand “true” and then added the point light visibility to the event “Press Trigger” (so it doesn’t show it continually at the beginning of the game) and it’s working now every time. Cheers mate!! But I still don’t understand why having this variable “false” at the beginning and then making it true when the trigger is press was randomly showing the laser or not. So so weird. Do you have a clue? But thanks for the tip, helped me a lot!!
The way you were setting the bool value for the set visibility was the problem, if you want to set it a little better don’t set it from the trace return value but instead manually basically the same way you set the “Enable Beam Right Hand” value.
Yeah I have a last question about these beam, there are lagging. When I move the controllers there is a kind of delay on how they are following them. Do you have any clue about this? I thought that it could be the fact that on event tick and then pretty expensive, but I tried another scene of someone having them on event tick as well and he didn’t get this “delay”…?
Sorry I missed this comment, what do you mean laggy? like it stays where it was and needs to catch up to the movement…like a time delay in the movement? How is it attached to your controllers? are you setting a target and source for the particle or it just a simple beam?
No worries yeah exactly like that, it needs to catch up on its movement. I created a beam which is just a child of the controller. But it has a source in the linetrace. Do you thing it can be the issue? Or can it come from the event tick? I took also a screenshot of how the material is set up. Is it maybe too expansive material for the beam?
No, the beam material looks fine it will be in the particle itself and how you attach it that will cause the lag…I think I see the issue actually, instead of constantly setting the beams source point on tick set it once manually that way it is always starting from the mesh’s location. Something else you could try experimenting with is instead of using source and target create a parameter in the particle to set the length and simply update the length of the beam. Doing that the beam will always face the same direction (whatever direction the mesh is facing) and just update its length.