I made a laser that is supposed to spawn and move the direction the player is facing when I press space. Everything else works, except the way the laser is moving.
https://gyazo.com/b13b1c237e3228991c79ac48ef534b93
As you can see, it moves to 0,0,0 for some reason. Why is this? I'm not good with CFrames so sorry if my code is really inefficient!
No errors.
local laser = Instance.new("Part")
laser.Parent = workspace.Debris
laser.Size = Vector3.new(0.6, 0.767, 3)
laser.BrickColor = BrickColor.Red()
laser.CFrame = plr.Character.PrimaryPart.CFrame
laser.Anchored = true
laser.CanCollide = false
-- code movement
local destination = plr.Character.PrimaryPart.CFrame.lookVector * 3
print(workspace:FindFirstChild(plr.Name).PrimaryPart.CFrame.lookVector)
ds:AddItem(laser, bulletSpeed) -- ds is debris service, bulletspeed is 0.7
local tinfo = TweenInfo.new(bulletSpeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local t = ts:Create(laser, tinfo, {Position = destination}) -- ts is tweenservice
t:Play()
wait(bulletSpeed)
t:Cancel()

1 comment
It's a little better, but still not working. https://gyazo.com/689729d6db2f853165bcbbbab16f9482