So in my script I add a linearvelocity so whenever a player is hit by a move it gets the origin which is the attackers position, then it gets the goal position which is the player. After getting these 2 vector3 positions it converts it into a cframe like this:
local direction = CFrame.new(origin, goal).LookVector
After doing this, I add the LinearVelocity’s VectorVelocity to the direction like this:
LinearVelocity.VectorVelocity = direction * 50 -- range of how fast they go
For bodyvelocities this works fine. But for LinearVelocity it isn’t working. I set RelativeTo to ‘Attachment0’, and added one in and connected it to the LinearVelocity. The velocity does push the player it just doesn’t push the player in the direction I want it to as described above.
What’s wrong with it? I’ve been working for hours tweaking it trying to figure out why it’s not doing what I want and I can’t seem to figure it out. I tried setting an origin of Vector3.new(0,0,0), I tried setting the origin to the attachment’s worldcframe. None of this works.