So, I’m trying to adjust my character’s Max Speed using a Float Curve where Time is the Angle, and Value is the Speed I set, ranging from a 45 degree angle going down to speed the character up, to a 45 degree angle going up to slow the character down, based on the tutorial at: Let's Make: Movement Speed From Slope - YouTube.
I have a Speed value that can be set in Blueprints from C++, and I can set the Max walk Speed as follows:
FMath::FInterpTo(Movement->MaxWalkSpeed, Speed, DeltaTime, 4.0f);
(Note the 4.0f is a temp hard code, I’ll move it out to a Lerp Speed variable after testing and tweaking it some.)
I have set up a calculation in the tick of the PC’s blueprint child as follows:
My question here is mainly this:
Instead of linking my Speed curve from c++ to BP, can I set the curve values in C++ so I can set the speed there instead? I have looked through the available members, etc., and don’t see anything that would indicate that I can set a Vector2 or similar structure as the values in C++.
This is mostly an academic question. I have no personal issue with my current setup, I’m just curious as I’m trying to come to better grips with the Unreal API for C++.