However, that automatically snaps the player’s camera to that location. I tried to find a way to do it gradually so it feels more like the player is looking in that direction… but I can’t figure that part out.
Does anyone have any idea of how that might be accomplished? In an ideal world, I figured there would just be a function of, “Set Control Rotation Over Period of Time”
Take a look at the Interpolate node. It does a smooth transition between two values. What a character is currently looking at, and what you want them to look at for example.
I think I learned how to use it by taking a gander at the security cameras in the blueprint office example.
I’ve tried using the Interpolate node a bit, but it seems like it’s still just snapping. I’m fairly new to using it, so it could be that I am doing something wrong. Here is my current blueprint:
However, even with that, the camera is still snapping to the point instantly instead of doing a gradual turn. Is there something that I’m missing with how Interp To works?
Your missing delta time.
The interp node needs to know how fast much time each frame is taking, so that it can keep the speed consistent. You can wire up the Delta time output from event tick, that is what I have done when I need to use an interp node.
I thiiink there is also a world delta seconds variable that might do the same thing, but I have not tried using that.
I’m replacing having it done on an event tick by having there be a branch off of a condition being false, and then a delay that simulates a tick. I’m doing this because I want to put this in a blueprint macro and not in the event tick of a level blueprint, as I’ll be doing this frequently in the FPS game.
My only problem right now is figuring out when the rotation for the player is complete, or near complete. I’ve experimented with a few things to set as the condition on the branch, but none of them have panned out.
Do either of you know of a good method to tell when an Interp’s current mark has reached its target mark?
Using the timeline as the check for the interp was what finally got everything working. Below is how it currently looks, with the guts of what’s moving the player in a macro in the first shot, and what the macro looks like in practice in the second shot.
You should also be able to simplify it a bit by using the RInterp node instead of converting a VInterp to rotation, and using the very useful “Find look at rotation” node So the “Get actor location” at the bottom left would be the location of the actor you want to look at: