Hi i’m trying to make a actor slowly gravitate to the camera rotation. I was using a script like this:
How this is really jerky in one direction.
Any idea how I could make this smooth?
Ed
Hi i’m trying to make a actor slowly gravitate to the camera rotation. I was using a script like this:
How this is really jerky in one direction.
Any idea how I could make this smooth?
Ed
I don’t know if you’re familiar with C++, but the spring arm has the ability to ‘lag rotation’, which is pretty much the same problem.
Short version: I’d suggest using the “RInterp To” node.
Long version: you’ll want to involve DeltaTime in your calculation so the lerp is affected by your framerate. Under the hood, the InterpTo node is just lerping with an alpha of DeltaTime * Interp Speed
. You can play with the speed to adjust the smoothness and amount of lag.
Additionally, something to consider: since you’re tossing the other elements of the lerp, you could just lerp the yaw value alone. This would be a slightly more complicated blueprint graph, but would save you two multiplications (for pitch and yaw) that you’re discarding.