Meshing Around with UVs


The next step is making it so that I can interact with the widgets that are displayed on my pages. Usually I’d have an actor with a widget component and having a mouse enabled would be enough to interact with the widget component. But I don’t have a widget component, I have a static mesh that’s getting its texture from a screen capture of a widget component so I need to get my pointer and my clicks from the surface of the letter, through the screen capture and to the actual widget inside.

I’m going to insert a button into my letter and see if I can make it clickable.

---

I tried doing it via code and got stuck trying to translate the mesh UVs to widget coordinates. I will try again tomorrow.

---

No luck again, I’m having trouble getting the UV hit location from the static mesh, must be something with the UVs or the collision or some different property. I’m going to create a simple plane static mesh and try it with that tomorrow.

---

Tried to insert a Plane in the actor, tried to create a Rectangle with the Modeling Tools, tried a Cube, none of it was giving me anything for the UV hit location, so it had to be my code.

Turns out the function I tried using GetHitResultUnderCursorByChannel from the PlayerController class just doesn’t seem to give me the UVs no matter what I hit so I tried doing it a different way.

I managed to get some kind of result back by using DeprojectScreenPositionToWorld together with LineTraceSingleByChannel and complex tracing enabled. I’ll switch back from the cube to my actual mesh tomorrow and see if what I’m getting back is usable.

Leave a comment

Log in with itch.io to leave a comment.