Why is this a thing, https://gyazo.com/bea0f522c17b5b17aa28ae2876addaae depending on where I look it changes the size, which make no sense
local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage.Remotes:WaitForChild("RemoteEvent")
remote.OnServerEvent:Connect(function(player)
local Player = game:GetService("Players")[player.Name]
local Pos1 = Player.Character.HumanoidRootPart.CFrame.p
local Pos2 = Player.Character.HumanoidRootPart.CFrame.lookVector * 75
local blast = Ray.new(Pos1, Pos2)
local blast, targets = game.Workspace:FindPartOnRay(blast, Player.Character, false, true)
local beam = Instance.new("Part", workspace)
beam.FormFactor = "Custom"
beam.Transparency = 0
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
local distance = (Pos1 - Pos2).magnitude
beam.Size = Vector3.new(10, 10, distance)
beam.CFrame = CFrame.new(Pos1, targets) * CFrame.new(0, 0, -distance / 2)
game:GetService("Debris"):AddItem(beam, 0.3)
beam.Touched:Connect(function(contact)
if contact.Parent:FindFirstChild("Humanoid") then
if contact.Parent ~= Player then
print("Contact")
end
else print("nohit")
end
end)
end)

1 comment
I think its a roblox issue. .