Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I apply kicker's lookvector and bodyforces to the ball?

Asked by 5 years ago

Hello there.. I hope to make a ball, that can be applied the kicker's current lookvector and bodyforce.

let me show you the script.

`~~~~~~~~~~~~~~~~~ -- Following Scripts are inserted in the ball. script.Parent.Touched:connect(function(hit) -- error, Cant get lookvector -- local hitterLookVector = hit.Parent.CFrame.LookVector

--  well, It's default setting
local ballLookVector = script.Parent.CFrame.LookVector
local ballBodyForce = Instance.new("BodyForce")
ballBodyForce.Parent = script.Parent 
ballBodyForce.Force = Vector3.new(0, 0, 0)

if hit.Parent:FindFirstChild('Humanoid')~=nil then
    -- the ball kicked to totally fixed direction
    --Well I have to fix here with some calculations. Right?
    ballBodyForce.Force = Vector3.new(0, 3000, 2000)
    wait(0.5)
    --I presume that following script will not be working as well...
    --or.. dsetory the BodyForce Value? huh?
    bodyForce.Force = Vector3.new(0, 0, 0)
end

end) ~~~~~~~~~~~~~~~~~ `

can somebody fix this? Or just gimme some clues...

Or.... without using bodymovers... Can I boost the ball's movement when something touch the ball? I've already tried Customphysicalproperties. It works but not fairly enough... :(

0
hit.CFrame.LookVector is what you're looking for. hit will be a BasePart. hit.Parent will most likely be a model, or the Workspace. Neither have a CFrame property. User#19524 175 — 5y
0
thx helpful ill try it later :) ShatteredThunder 0 — 5y

Answer this question