I’m creating a laser beam effect for my game and I’ve been searching the devforum for a solution, but I can’t seem to figure out the issue with my position tweening. I understand to scale a part in a single direction you have to tween both the Size and Position properties, but I can’t figure out how to move the beam part in the opposite direction, my current script just causes it to fly across the map.
local TweenService = game:GetService("TweenService")
local beam = Instance.new("Part")
beam.Shape = Enum.PartType.Cylinder
beam.Material = Enum.Material.Neon
beam.Color = Color3.new(1,1,1)
beam.Anchored = true
beam.Size = Vector3.new(3,3,3)
beam.Parent = Character
beam.Position = Character:FindFirstChild("RightHand").Position
beam.CanCollide = false
beam.Rotation = Character:FindFirstChild("HumanoidRootPart").Rotation + Vector3.new(0, 90, 0)
local tweeninfo = TweenInfo.new(1)
local scaletween = TweenService:Create(beam, tweeninfo, {Size = Vector3.new(30, 3, 3)})
local pos = beam.CFrame
local movetween = TweenService:Create(beam, tweeninfo, {Position = (beam.CFrame * beam.CFrame.Rotation).LookVector})
scaletween:Play()
movetween:Play()