VR Vive: Point controller at asset and call behavior on click?

So i’m pretty new to UE4 and used to work in Unity. What i’m trying to do is pretty simple and i can get this working in C#/JS in Unity.
However i have no idea how to do this in UE4 with BPClasses.

what i’m trying to do is change the video texture/material (no idea what it’s actually named) that i have playing on a tv screen in my scene, whenever i point and click on a specific cube in my scene.
I have around 4 videos that can be switched and thus need 4 cubes.

Scene now:
http://puu.sh/srNi3/64401a2d1e.png

Like i said, it’s a simple thing to do. but due to my lack of knowledge and experience with BP, i have no idea where to actually start.

I need a ‘‘laser’’ or a drawlinetrace debug, coming out of my right motion controller. when this line comes into contact with one of my cubes and i press R trigger, it switches the video that’s playing on my tv screen to the desired video, that is connected to the cube i ‘‘clicked’’.

I have a small start where the videos change by just pressing the trigger on the R motioncontroller and this is done in the level blueprint.

If someone could help me out either by guiding me or putting me into the right direction from how to get a good BP setup basis for this, that’ll be really appreciated!!

EDIT:
I’m willing to provide with more info and screens, in case my post doesn’t make any sense to you!

You have to simply do a line trace. This linetrace will return the actor you hit.

What you do with this actor is up to how you do what you want to do. If you want to get the material you can simply use the node GetMaterial.

To draw the laser you can just attach a long thin cylinder that represents your pointer and then call the LineTracebyChannel node along it.

Hth

I created a trace out of my R motioncontroller with the help of the UE4 Docs.
It now traces worldstatic objects and this is my BP now:
http://puu.sh/ssYno/c11aa31699.png

Any idea how to get specific objects instead of object types, so i can call my cubes?
I also have no idea how to make it so that if the trace finds one of my cubes, it changes the media source one a different object. any idea how to get this done?

EDIT:
So i need the right side (media sources) to be connected to the left side. However i have no idea how to connect them properly so they it works. any ideas?
Also my line trace now knows when it’s hitting each cube, due to me creating new object channels

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/

This shows you how. I will take a closer look later when i have the time.

You only need to write WorldStatic once.

I would also recommend using trace by channel and set the channel to visible. Then you get the specific object, not the object type. You might want to create a blueprint that looks like a cube but has some custom functions in it. That way you can check if the cube is your new type and then simply cast to it.

That BP script makes no sense to me. Make a class called BP_MaterialSelector and inside this class add a material variable. Put a cube inside this blueprint class and put this class in the world.

Then check if what you hit is of that class and, if it is, get the variable from it after you cast the class to BP_MaterialSelector. Then send that material to the screen.

yes and i already have this working. the only thing that i can’t seem to get to work, is when my trace hits (for example) the red cube it changes media source to videoX. and when my trace hits green cube the media source switches to videoX1 etc.

This is what i have now:
http://puu.sh/stPqk/1dc4c80493.png

But this isn’t working properly.

I got it fixed, i let someone with a little more experience in UE4 take a look at it.

This is what we came up with:
http://puu.sh/stUhU/da31f5fd44.png

Instead of looking for a particular object, it’s now looking for a name. not very efficient, but it works for a very very small scene.

thanks!

sorry i have no idea how to do that.
what kind of variable type do i need for this ‘‘material variable’’ within the new BP?

what node do i need to use to check if this class has been hit and everything after that.

EDIT:
I got it fixed, i let someone with a little more experience in UE4 take a look at it.

This is what we came up with:
http://puu.sh/stUhU/da31f5fd44.png

Instead of looking for a particular object, it’s now looking for a name. not very efficient, but it works for a very very small scene.

thanks!