i create a rotator out of 2 dynamic floats which depends on the mouse input, but unfortunately it isnt smooth and keeps jumping pixels especially at slow mouse input. I heard about RInterpTo but i dont know what to do with the ‘target rotation’ pin i only want to get a smooth rotation.
Using something similar to zoom my camera in and out “smoothly”. It is somewhat inefficient and ideally you’d have a custom event set up to update it rather than event tick.
There, no event tick, only updates when I actually zoom. However since you’re gonna be rotating the camera a lot I suppose it wouldn’t be a big deal using event tick but… might as well not if you can avoid it.
You’re completely right about that actually, I stopped using the interp speed because I handled the smoothness with the camera sensitivity variable instead which gave the desired result. Thanks for pointing that out so I can chuck it out of the event, I had completely forgotten.
The reason this works in its current form is because of the nature of a scroll wheel. You either let it spin, which makes it smooth no matter what, or you move it by increments, in which case you just need to “hide” the chopping with a low sensitivity.
Actually, further to your comment there, I decided to make this so that a single button press sets your zoom distance and interps smoothly between two options. I made a simple function in the character blueprint:
Then set the values by key presses, updating the time and checking every tick if the camera distance is at the desired zoom distance. If it is not, it runs the function:
Again, not super efficient with the event ticks, but it gives a really nice result and you can change the speed of the interpolation to get the desired effect. This should be easily adaptable to rotation.
If you wanted to do this via scroll wheel it would look like this:
In this case the camera sensitivity and the interp speed are the key things you want to fiddle around with to get something you’re happy with.
Again though… event tick for something that only updates when you press the keys, better handled by events. It does add a really professional feel to the camera movement though.
I’m sorry for taking this so far off topic btw, hopefully this gives the OP some ideas on how he can achieve what he is trying to achieve.
Well you need to set a current rotation. In the start of whatever else happens in your function, you need to set a what the current rotation is at the start of your movement so it has something to rotate from. The movement you perform then becomes your target rotation.
If you need help with the RInterp to, check out Mathew Wadstein who is part of Epic Staff, he makes great videos of various functions and breaks them down really nicely:
Yes, as @Crowley Cain says… you could use a Rinterp and definitely check out Matt Wadstein’s YouTube tutorials on Rinterp and Lerp (he’s a great resource for learning stuff generally)
you can also use a Lerp driven by a timeline… to interpolate between your current and target rotation using an alpha value