UE C++ Camera Jump on Standup: Race Condition / 1-Frame Teleport on CStopCrouch

Hello, I’m currently learning C++ and Unreal Engine, often using AI assistants, but I’ve encountered a problem I can’t solve myself. When I call the CStopCrouch() function, the camera (which is attached to the character) doesn’t smoothly transition to the standing height. Instead, it jumps/teleports for exactly 1 frame, returns, and then starts smoothly interpolating using FInterpTo in Tick().

Using a float value?
You can add FMessageLog(“PIE”).Info(FText::FromString(FString::SanitizeFloat(FloatValue))); where ‘FloatValue’ is the name of the variable you are using.

It will add a message and ‘tell’ you what values you are using. When a wrong value is used for a frame, you will still be able to read it (Message Log or Output Log).

I used this method and I discovered that the ‘.IsReversing()’ function (UTimelineComponent) was returning wrong values during a frame making a bug on my code (UE5.1). So, I created my own code to fix it.

For some reason, you are starting with the wrong value (maybe calling ‘SetComponentTickEnabled’ as true before ‘telling to start the smooth transition’?).

Sincerely…