In this lesson, when I was working this on my own, I looked up the FVector API and found FVector::Distance(). I used this in my code rather than Magnitude as shown… is there any reason we couldn’t use this function for the purposes of moving the platform?
My current code that uses this:
I used FVector::DistSquared instead of FVector::Dist, and calculated the initial distance in BeginPlay as well. DistSquared is a bit more efficient since it can skip the square root, which doesn’t really matter in this case but is something to keep in mind IF this code were to run at a high frequency.