Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

3 comments

0

Just use BodyPosition.

0

i feel your pain man. i hate bodyvelocity and bodyposition. wish I could help

0

@Elixcore same,problems everywhere.

1 answer

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.

2 comments

0

forgot to edit the out the comments

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

This discussion is preserved as it was. New answers, comments, and votes are closed.