It works and will smoothly turn the cam to look into the direction of “building-center”. However the problem is that it turns smoothly/slowly/over a couple of frames. I would like this rotation to be instant. Does anyone know how I can achieve that? Should I use other blue-print functions? Change some settings?
So to summarize: I would like rotation in this case to be instant, but with this function it’s smooth/it lerps.
Ah, but it still does not change rotation instantaneously. It unfortunately doesn’t solve my issue (that the rotation should be instantenous the next frame, but even with the change to the blueprint above it still rotates smoothly over several frames instead).
Do you know if there’s a setting or something one can change, so it rotates to its position instantly the next frame?
“Focus on Selected Building” is called everytime horizontal input is given (so arrow-keys or ‘A’ or ‘D’). So it’s called only when those input values are non-zero … Now that you mention it, that could be it!? Maybe I let go and it’s not called?
I’ll try to put the function-call in “Event Tick” instead, thank you! I’ll try it tomorrow, I’ll tell you if it worked out! Thank you so very much for your help already.
There is still a drag to the rotation (it’s not instant). See video below, where the camera should have the building in the very center at all times (but the building is a little off center when the cam is moving, until it stabilizes when the cam stops moving):
Because the rotation is not instant (it drags) the camera “drags” when looking at the building, it doesn’t stay centered around the building. So when I press “right”, instead of rotating perfectly around the building, it slowly drift away from the building while ‘kinda’ keeping it centered.
I’m not the author of the whole movement system in the project, so I’m thinking there may be a setting somewhere on the camera that toggles on “smooth movement always” or something? Does anyone know if a setting like that exists in Unreal cams/moveable objects?
Can you share more context on what the blueprint is, what owns the camera, etc? Because this code should work on its own, so there’s something else affecting it. Is this a character blueprint perhaps? If it has a camera spring arm, check out the “lag” settings on it.
Jared thank you so much for helping so patiently! That was it, the camera’s on a springarm with lag enabled:
When I disable the lag on the springarm the movements become instant. Thank you!
I toggled on/off the lag-settings and ended up keeping them on but tweaking the “Camera rotation speed” to keep the movements looking smooth but very fast.
Solved! People like you keep communities like this thriving, thank you