guys pls help me with this code I’m trying to move a wall to a certain location when the player overlaps with a switch but instead of a smooth transition the wall just jumps to the new location which is not what I want
I believe there is another interpolation function which is VInterpToConstant().
The VinterpTo version is meant for motion that has a faster start speed and slower end speed; the VInterpToConstant() has a constant speed from start to end - which is likely the one you are looking for,
I hope this post can help you with your problem. =)
Also, are you moving an actor or a component? If the latter, then consider to use UKismetSystemLibrary::MoveComponentTo. Unlike the Lerp functions, this function doesn’t requires continuous execution.
i’m moveing a component. my actor has 2 meshes and 1 collision box so 1 of them needs to move and the other one is a switch which is supposed to trigger the function.
That’s what Interp actually does, you need to call it repeatedly from a Tick or Timer using a low InterpSpeed, so it moves a little bit every frame (that’s why it takes a DeltaTime argument).
when I put the function call in tick it shows strange behavior. the wall moves halfway through but then stops even tho in output log i see that the function is being called everyframe, the component doesnt get to the Endpoint it just stops between the 2 points and when i start overlapping again it goes to the endpoint.
I had similar problem …
VInterp in C++ does not work as expected for slow speeds, if you want to slowly interp something …
And yes, even if you call it on Tick, same result …
MoveToComponent seems to be the magic most flexible solution for this so far …