How would I go about kicking a ball?

Since its a sphere you could also just do a simple magnitude check lol

1 Like
instance.Velocity = HumanoidRootPartinstance.CFrame.LookVector * 10

What is a magnitude check exactly?

Remember in geometry class where they told u you can find the length of the hypotenuse of a triangle? It’s basically that but in 3d, it tells you how far away you are from a point

function kick(hit)
  local players = game:GetService("Players")
  if hit.Parent == 
  players:GetPlayerFromCharacter(hit.Parent) then 
script.Parent.Velocity = hit.Parent:WaitForChild("HumanoidRootPart").CFrame.LookVector * 10

    end
end
script.Parent.Touched:Connect(kick)

Oh, well this is still a really useful tool you should use. The problem with touch and magnitude is that they are often delayed, unresponsive, or inaccurate.

1 Like

It’s actually the opposite, touch and your custom libraries have delay as they have to do complex math

1 Like

I think a vector force would be good.

this should work tell me if it doesn’t, it doesn’t go up but I’ll find out how to fix that

Workspace.Part.Script:1: attempt to index nil with ‘CFrame’

line 1 is the function, weird?

Wait that was wrong sorry! I am very dumb give me a second lol

fixed one thing re-add it now 30char

Where does that script go in the game?

Inside the ball/part 300000000000

What do you mean by that? is that what I need to name the part?

also * 10 in the script is the speed, if it’s too low change it to like * 100 or something

Nono, that’s because i need to have 30 letters minimum or else i can’t reply

oh I see lol I’m new around here

No matter what I change the speed to the ball is not affected by the script at all. I’m not seeing anything in the output so that’s why I’m confused