I am trying to make the camera move from side to side with the mouse movement alone. Right now, in order to move the camera with the mouse, I have to click a key in order to do it. I just want the mouse movement to rotate the camera and I believe I have most of the code, but I’m not sure how to get the player camera reference to work. Here is the code I set up for the mouse input so far
What class is this Event Tick code in?
It’s in my level blueprint.
Yeah you want to work directly with the character or controller for this.
Camera is a character component. From character you would use Get Controller
. Then drag the camera from My Blueprint tab into the graph.
So i don’t make it a variable? Though that didn’t work anyway since it won’t connect.
I only have a camera actor in the world and the follow camera in the player controller. I don’t have a blueprint for it.
Just code it in the controller class then.
This is what the tick node looks like now but the camera still doesn’t move unless I hold any of the mouse buttons down. I am just lost lol, and these video tutorials are not helping in the slightest.
Use Set Control Rotation
your maths is a bit wrong too, you may want to GetHitResultUnderCursor and FindLookAtRotation between the Character/HitResult. you may want to RInterp it too