Hi, I’m trying to have the player camera (first person) move to an object in the scene when I click on it. I have the “clicking on the object to do something” part all done (not important). It’s the moving camera part I’m struggling with.
I tried this:
Do you want to zoom in (alter Field of View) or move the camera - these are 2 completely different things. You talk about zooming in but attempt to move it instead. Please clarify.
The rotation does not work because the first person camera inherits Control Rotation from the Player Controller or the Pawn which simply overrides the behaviour in this case. It can be changed run-time but can be tricky to work with.
If you want to proceed this way, disable the camera’s Use Pawn Control Rotation, and enable it once the camera reverts.
Is there a better way to do this?
Perhaps you want to switch to another camera, as in:
the player clicks an object to inspect it
the camera view changes to see the object better
This is usually done via Set View Target with Blend node which also provides a rudimentary animation. It’s by far the most common way to do that kind of thing.
Thanks. Sorry, I used the wrong word. No, I’m not trying to do anything related to Field of View. Like you said, I’m trying to:
The object is a flat screen on a wall, in this case. I tried to use Set View Target with Blend node, but the rotation is all wrong, the camera clips through the object and ends up at the wrong angle. And I have no option to control the coordinates with that node, in case I want to set a certain distance from the camera to the object.
Does the flat screen on the wall have a camera we can to blend to? In order to blend, you need a camera on the target actor, if you do not provide one, default transform will be used.
I’d keep the functionality either in the Pawn or the Player Controller. Unless the flat screen has a bunch of controls, like flipping through the channels or some fancy remote cctv controls.