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

How can I make bodyvelocity increase in the direction of the look vector?

Asked by
Mystdar 352 Moderation Voter
8 years ago

I want to move the player's torso in the direction they're facing, thanks.

1 answer

Log in to vote
1
Answered by 8 years ago

Firstly, you will need to to add BodyVelocity to the object you want to move. Then We need the Parent the BodyVelocity to your chosen object. This script is a example of how to make the Player's Torso move to the direction of where the character is looking which mean's that you'll need to adjust it to your fitting.

local Player = game.Players.LocalPlayer--Gets the LocalPlayer
Player.CharacterAdded:wait()--Wait for the Character to load
local Char = Player.Character--Variable referencing to the Player's Character for quick access. 

local Body = Instance.new("BodyVelocity",Char.Torso) --Create BodyVelocity and Parents it to Player's Torso.
Body.maxForce = Vector3.new(1e7,1e7,1e7)--The the Maximum amount of force the BodyVelocity can use.
Body.velocity = Player.Character.Head.CFrame.lookVector*40*2--Change the Body's Velocity to the way the Character's Head if facing.

If you have anymore question/comment about BodyVelocity, then please feel free to leave comment down below.

-UserOnly16Characters

Ad

Answer this question