Player:Move(Vector) - how can i get that vector according to facing part?

How can I get a vector that I can use to move the sonic character in function :Move(the Vector I want, false)?


Like in this image the vector must be vector3.new(0,0,1)

image


And here the vector must be vector3.new(1,0,0)

Is the function done on the server, or the client?

Assuming I understood you correctly, you want to get a vector that will move you away from the part? Or is it towards? Either way it’s almost the same solution.

If you consider simple math, you can take the player position and minus it by the part position, thus you get the difference between the two. Convert it to a unit vector and you’re done. That will work for moving towards, for the reverse you just take the part position and minus it by the player position instead.

Lmk if I misunderstood you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.