If you have a 0 in the interp speed, it will just jump instantly to the final destination… also remember to plug in delta time
ok! the picture is showing that your RinterpTo is set up slightly incorrectly… you need to interp from an original value to a target value… this bit had me scratching my head too initially. RinterpTo is VERY reliable except for gimbal lock (if you start to see hitches around +/-90 degrees, time to download the quaternion library if needed)
Check out Matt Wadstein’s video on Rinterp WTF Is? Interpolation - RInterp Node in Unreal Engine 4 - YouTube… he’s a great asset
Basically interpolate the Current which should be the source rotation (it can be a variable or an actor/component rotation).
I am having trouble settting using the RInterp to, It still teleports to the rotation which I want it to interpolate to, I have check that I should be doing everything correct.
I have already plugged in the delta time, as well as set delta time to 1 but it still jumps, is it a bug in the engine?
Thought I would upload a picture
Thank you very much, A careless mistake i made.
It’s still badly cropped, not showing what is really important…
At a glance, it’s set up the other way round.
Current should be your Actor Rotation, Return Value should Set Actor Rotation. Target should be the Atan2 here. Hard to tell for sure without seeing the rest, though.
Hello Everybody!
That fits with my issue too:
So I just made this example with a cube…but it still makes the point, I’m trying to give random Y and Z rotations, 1 second long, every 3 seconds (where the cube should idle for 2 seconds that is)
the setup:
the result:
https://vimeo.com/760519646
as you can see, some kind of interpolation happens, but only once on start, then it gets stuck, curiously jittering at an exact average value of the range, I set on the random nodes.
Notice I set Y random float ranging (20-60) and Z (130-160) and cube get stuck at 40Y 145Z
any ideas?
Thank you!
Several.
-
InterpSpeed is not necessarily one Second its “X” Units of Delta Time (Delta time is the speed between each frame, generally a fraction).
Or more appropriately 1 * delta time in your case - just delta time seconds. -
Random output doesn’t necessarily generate a new random each tick - and even if would ( which it could and should imho) you would then be setting the rotation target to a different value on every tick…
First create an event → drag from random, save to variable → drag from random save to another variable.
On event tick (drag from deltaTime make savedvariable):
deltaTime + savedvariable → set savedvarible.
Branch.
if savedvariable >= 3 → execute event (random vars are set) → set savedvariable=0
output of false should probably be empty - or you can move the addition section to the false branch (because technically adding beforehand gives you a false second count when the branch comes around, you should add afterwards, but things are rarely so picky about a single frame time).
Connect both True And False into the RinterpTo
Or more appropriately put the node in front of the branch so the interpolation occurs before the frame time is added up to the total.
- Remove the delay.
Rinterp needs to keep on running over and over.
IT works internally by taking the delta between Current and Target rotators and adding the value of it as the output.
You are essentially stopping it from executing over time.
Except RinterpTo works sort of “wierd” over timelines.
IF you are going to use a timeline at all, just output the rotation you need every second yourself…
Timeline output * value you want should do it
Not suggesting using rInterp.
Lerp is sort of similar in this case no?
I mean, it’s easier than timeline * variable, I suppose…
@MostHost_LA @Everynone Thank you very much for the input, this is brilliant!
I have managed to reproduce @Everynone suggestion(it’s a bit easier to follow with the image of the blueprint), and it seems to work as I need!
but I will certainly try @MostHost_LA too! seems like that could be useful for many things else.
Thank you very much!