Answers for "how to use lookVector in roblox studio"

0

how to use lookVector in roblox studio

-- Preferred way
-- moves it forward 5 studs (relative to it's orientation), forward is NEGATIVE on the Z-plane
part.CFrame = part.CFrame * CFrame.new(0, 0, -5) 

-- Way using lookVector
-- If facing straight forward, lv is <0, 0, -1>
local cf = part.CFrame
local lv = cf.lookVector
part.CFrame = cf + (lv * Vector3.new(5, 5, 5))
Posted by: Guest on April-15-2022

Browse Popular Code Answers by Language