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

How to set the Velocity of a "BodyVelocity" to a player's torso position?

Asked by 6 years ago

What's in the title basically..

I have this script in a gun that works fine:

local BV = Instance.new("BodyVelocity",bullet)
        BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
        BV.Velocity = mouse.Hit.lookVector *300

But now I'm working on a special boss that throws rocks at players, and I'm not sure how to set the velocity to the player's torso position..

--v is the players by the way..
local BV = Instance.new("BodyVelocity",rock)
        BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
        BV.Velocity = v.Character.Torso.CFrame.p * 50
--The rock just flyes off to the direction the boss is looking at.

I aprecciate any help!

0
Just use BodyPosition. KingLoneCat 2642 — 6y
0
i feel your pain man. i hate bodyvelocity and bodyposition. wish I could help Elixcore 1337 — 6y
0
@Elixcore same,problems everywhere. wilsonsilva007 373 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Now i dont know if this would work at all

since i dont use body velocity at all

so dont hate pls

you can probably get what you want through lookvector

--v is the players by the way..
local BV = Instance.new("BodyVelocity",rock)
        BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
        BV.Velocity = v.Character.Torso.CFrame.lookVector * 50
--The rock just flyes off to the direction the boss is looking at.
0
forgot to edit the out the comments JohnJohniamm55 21 — 6y
0
I tried that too my good friend but that will only make the rock go towards the lookvector of the player's torso,I'ma try some stuff i noted down wilsonsilva007 373 — 6y
Ad

Answer this question