Moving props infront of the player

I am trying to make a football game where my ball prop is moving infront of the player’s feet. I tried using MoveTo() Function to move the ball towards the player position, which I found using this line of code:
if(PlayerList := GetPlayspace().GetPlayers(), FortniteCharacter := PlayerList[0].GetFortCharacter):
PlayerPosition : vector3 = FortniteCharacter.GetTransform().Translation
but it moves the ball towards the center of the player. What do I do?

you’ll have to get the local forward of the players rotation and normalize it and then use that and a distance to offset the balls next location

NPC Behavior Navigatable GoToPoint Programming Question - Development / Programming & Scripting - Epic Developer Community Forums (unrealengine.com)

look at the code i wrote for this guy and it should point you in the right direction.

I tried using the code in the link you sent and replaced anything that had to do with the prop or the spawner to the ball and the player, but it is still no use. my ball is stuck and doesn’t move, can you please explain how to overcome this problem in a bit more detail as I am a complete noob to uefn.

Can you send all of the code involved with moving this ball?

I’m assuming you have already, but make sure once you build verse code and pull out the verse device, that you link the creative prop you’re trying to move

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Characters}
using { /UnrealEngine.com/Temporary/SpatialMath}

See Create Your Own Device Using Verse for how to create a verse device.

A Verse-authored creative device that can be placed in a level

Football_movement := class(creative_device):

@editable
ball : creative_prop = creative_prop{}
Magnitude(vector:vector3):float=
    return Sqrt(Pow(vector.X, 2.0) + Pow(vector.Y, 2.0) + Pow(vector.Z, 2.0))
Normalize(vector:vector3):vector3=
    Mag := Magnitude(vector)
    return vector3{X := vector.X/Mag, Y := vector.Y/Mag, Z:= vector.Z/Mag}
dribble()<suspends> : void =
    loop:
        ballTransform := ball.GetTransform().Translation
        MoveTime := 0.001
        if(PlayerList := GetPlayspace().GetPlayers(), FortniteCharacter := PlayerList[0].GetFortCharacter[]):
            PlayerPosition : vector3 = FortniteCharacter.GetTransform().Translation
            PlayerRotation := FortniteCharacter.GetTransform().Rotation
            PlayerYawPitchRoll := PlayerRotation.GetYawPitchRollDegrees()
            if(NewYaw := PlayerYawPitchRoll[0] - 90.0):
                if(CorrectedPlayerRotation := MakeRotationFromYawPitchRollDegrees(NewYaw, PlayerYawPitchRoll[1], PlayerYawPitchRoll[2])):
                    PlayerLocalForward := CorrectedPlayerRotation.GetLocalForward()
                    Normalized_Forward_Vector := Normalize(PlayerLocalForward)
                    Dist := 10.0
                    Target_Location : vector3 = vector3:
                        X := Normalized_Forward_Vector.X * Dist
                        Y := Normalized_Forward_Vector.Y * Dist
                        Z := Normalized_Forward_Vector.Z * Dist
                    ball.MoveTo(Target_Location, PlayerRotation, MoveTime)
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
    dribble()

also, I have removed the prop_loc + from the X, Y and Z variables because the ball drifts slowly in one direction and doesn’t follow anything. Now all it does is sink into the ground and rotate towards the player, but not move towards the player.

Is likely that you need to change the mobility on the static mesh to moveable
image

still doesn’t work