Confirmed that MoveTo()
is fixed.
I reran my little test above and it all seems smooth now. [Relevant snippet from earlier post is below.]
If you change to the simpler MoveToPositionalExpected()
instead of MoveToPositional()
it works as it should be expected. No need for remembering the current position and teleporting and no need for a few frames to wait, etc.
It will still be nice to have out-of-the-box movement commands that adjust according to their target, more sophisticated pathing commands and socket / transform attachments - though this at least works and looks good visually.
#===========================================================
# Move to specified offset of positional target adjusting over time as needed
(Prop : creative_prop).MoveToPositionalExpected(Target : positional, Offset : vector3)<suspends>:void =
TargetRotation := IdentityRotation() # [Could specify a target rotation or make relative to Target]
loop:
TargetXform := Target.GetTransform()
TargetPos := TargetXform.Translation
Arrived := race:
block:
MovePos := TargetPos + TargetXform.Rotation.RotateVector(Offset)
# The farther apart the longer the time to get there [could pass in adjustment]
TimeToMove := Distance(TargetPos, Prop.GetTransform().Translation) * 0.005
Prop.MoveTo(MovePos, TargetRotation, TimeToMove)
true # Arrived
block:
# Update move to location occasionally [could pass in value]
Sleep(0.5)
false # Not arrived
if (Arrived?):
break