I can't see any use in them when you have lookvector. Plus, they seem to not be working. I tried everything and nothing happend.
while wait() do workspace.hi.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.UpVector print(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.UpVector) end
LookVector, RightVector and UpVector
UpVector
returns a direction facing upwards of a CFrame, RightVector
returns a direction facing the right of a CFrame, and LookVector
returns a direction facing forwards of a CFrame.
These are returned as Vector3's and are normalized, meaning that they have a magnitude approximately equal to 1; have used .Unit
on them
These can be used for:
Propelling a character forwards:
Suppose you want a player to propel themselves forward or in any other direction with a small force. You can use:
local bv = Instance.new("BodyVelocity") bv.Velocity = player.Character.HumanoidRootPart.CFrame.lookVector * 50 -- moving them at a velocity of 50 studs forwards bv.MaxForce = Vector3.new(1, 1, 1) * math.huge bv.Parent = player.Character.HumanoidRootPart game:GetService('Debris'):AddItem(bv, 1) -- removes the BodyVelocity after a second
They're simply unit vectors which express the direction of faces. If they're not perpendicular to eachother, then you get some seriously wonky rendering, which you can see if you generate some inverted CFrames.