VR - use the WidgetInteraction laser pointer with a mesh

Hi,

I’m new to UE4, but not to game development. I’m working on a VR project, just starting.
I want to have a laser pointer to be used to “click” on objects (triggers, meshes, etc.) I found the WidgetInteraction and have the exact same thing I’m looking for, but as the name applies it works on widgets, is there a way to use the blueprint of the laser pointer on objects or just is there a one deigned for objects?

Thanks.

is there a one deigned for objects

For non-widget objects a simple trace will do it:

Image from Gyazo


Ideally, you’d use a blueprint interface to communicate with targets without the need to cast. So depending on what the trace hits:

  • triggers - opens a door somewhere else
  • meshes - gets kicked around
  • tree - timbeeeer!

And all can be done with the same trigger. The implementation of what happens when the generic trace hits is in the target actor.

Hello, thanks for your help.
I am working on a way with ray cast, but as I said before, I’m working in VR so I’m looking into it, my question was for the laser effect to be used as a pointer, in my project the clickable items are meshes and when clicked on an info be displayed like a text, image, or a sound will play, so for the ray cast I think I’ll cast to blueprint and call a function to show the info. But again my question was for a way to use the effect.

Afaik, the interaction component is tracing for widgets components exclusively. But you can leverage its data to an extent:

Or line trace, whatever is needed. And rather than running it on Tick, you’d do something along the lines of:

347297-screenshot-6.png

I’ll be honest with you, I don’t know if that’s will give me what I want, but I’ll try it and see, thanks a lot for the help.

If the plan is to interact widgets in VR / FPS, you must use the interaction component that does the forward trace of whatever it’s attached to - usually a motion controller. It cannot interact with other world objects, meshes and so on. You need an additional trace for that, as above.

How to visualise it, is up to you. But it will rely on the above. Not the other way round. The red (?) laser thingy does nothing on its own.

Unless you make your own laser with bells & whistles, that is. Attach a collision sphere to its end, for example (but this will still be based on the trace…)

Good luck!