How to rotate player camera, when overlapping with widget blueprint

Hey! I’m a beginner to unreal. But anyways I’m creating a little game. Now I want the player camera to rotate when their mouse cursor overlapps with the boxes on the left and right side on the screen (see image below). I’m just wondering how to do this. I have tried a little myself, but can’t manage to get it right. Help is greatly appreciated!!!

the button has those like on click,on mouse over event.just use a button for the widget background.set it’s alpha to 0.

Oh and I’m mostly wondering how to do the blueprint part. Here is what I have tried/made so far:

Like I said, I’m a beginner so my code is probably not that great…

The blueprint should work.
It doesn’t behavior like you expected?

if so can you explain what part of it you think is not you want?

I’ll try to help you if i have the knowledge

I don’t really know what’s wrong. I have changed the blueprint to print text when I hover over one of the buttons/Bars on the side of the screen. But the cast always failes. I have know idea why this is. But like i said I am a noob, so I guess it’s kinda expected??

Heres the code:


Oh and I’m casting from a widget blueprint to the First Person Character.

Need help…

Where do you get the character ref variable?Instead of print failed,you could print the variable so you can see what it is.and a simple way to get the character ref is use “get player character” node,and then connect it to the cast to node.that way it should not fail.

1 Like

Using “Get player character” seems to have worked. Thank you! I’ll be sure to reply if there is anything else that doesnt work.

Try this.it’s not fancy,but friendly to beginner.

1 Like