Map range clamped camera rotation

Hello, I’m trung to make camera get further away when it looks down and get closer when it looks up. Pne guy suggested me to use, map range clamped and it works perfectly for him, but for me it doesn’t.

Then, it’s not what i asked in previous post. it really looks like what i need, but i need it to look up from down too and as i descibed above it doesn’t work smoothly.

guy suggested me to use, map range
clamped and it works perfectly for
him, but for me it doesn’t.

It did not work perfectly, you never mentioned you needed it clamped, here’s how you can clamp control rotation:

Did you clamp the control rotation as demonstrated above in the Begin Play event? This would prevent the Probe’s interaction and the jerky movement you can see in your animation. You can choose a more shallow angle. If you want it to be smoother, `Enable Camera Rotation Lag` (and / or movement) in the Springarm’s settings and set its value to a lowish 4-5.

Do note that you have automatic camera collision on the springarm called a Probe, it’s responsible for the sliding collision with the geometry rather than allowing the camera to clip through.

You said that it looked perfect in the quick anim I demonstrated previously, here’s how it works with the abovementioned clamp and applied lag:

You can write your own interpolation to ease the camera movement even further, ofc. If that’s not what you want, then I’m not sure what is. You will need to be more descriptive than just saying ‘like this other game’.

Ok, i’ll try to explain it in more details. The camera movement i want is changing distance at certain angles. What i want is to camera get further with every angle from 0 degrees to -90 degrees (Y axis, top-down view). My spring arm length is 300, that means, that every degree is going to increase it, so in the 90d i want it to be 400.
And the important thing is that i want the same thing but for down-top view, 0d to -90d, but opposite. When it gets to -90 i want spring arm length be 200. And be smooth
I once did it with timeline, but i forgot, maybe there is more practical way to do it.

Maybe you were referring to the gimbal lock? Not sure how your camera is supposed to work. Try this:

If that’s not it, we’ll need more info.

Yeah it is what i need, thank you! Of course i have to make it perfect for my own project, but thanks anyway! Btw What is delta seconds and find look at rotation, and why do we need camera location and not rotation?

Delta Seconds is the time between frames - in this case it is used to make calculations frame-rate independent. If you run the game a on low-end machine at 30 fps or on a monster rig and update everything at 240Hz, you still want the player to turn at the same speed - you’ll want the controls to be consistent.

find look at rotation

In my original example I did not realise you’d want to look up (I actually thought you do not want to lookup at all).

The pitch of the look is 0-360 degrees, as you rotate the camera, you eventually hit the horizontal plane and start looking up. You’d jump from 360->0 and this would cause a jerky motion as the camera tries to adjust quickly.

Here, the `Find Look At Rotation` node produces a [ -90 - 0 - 90 ] range instead, which is a continuous value range allowing for a smooth transition. It uses 2 vectors to determine a rotator. It’s useful for all sort of things.

The best example is a turret aiming a player. You provide the turret location and the target location - the resulting rotator allows you to point the barrel at a target.

Same happens above, we take position of the camera and the position of the player and get the resulting rotator; we’re interested only in Pitch here, though.

tahnk you, you are a savior!! God bless you