Hello, I’m trying to make some sort of a blast/fireball that shoots in the direction the player is facing, however for what ever reason the trajectory of the projectile has an arc to it that is more severe depending on what direction the character is facing. The peculiar thing is, if I don’t use look vector and instead I use a fixed direction vector the projectile goes straight like I want it to.
Here is my script:
local rs = game.ReplicatedStorage
local fire_blast = rs:WaitForChild("fireblast")
local blast = rs:WaitForChild("blast")
fire_blast.OnServerEvent:Connect(function(player, lookVector)
local char = player.Character
local blast_clone = blast:Clone()
local hrp = char:WaitForChild("HumanoidRootPart")
local velocity = 80
blast_clone.Parent = game.Workspace
blast_clone:SetNetworkOwner(nil)
blast_clone.Position = hrp.Position + lookVector*10
blast_clone.CanCollide = false
local at = Instance.new("Attachment", blast_clone)
at.Name = "Attachment0"
at.Position = Vector3.new(0,0,0)
local v_force = Instance.new("VectorForce", blast_clone)
v_force.Attachment0 = at
v_force.Force = Vector3.new(0, blast.Mass * 196.2, 0) -- 196.2 is in studs/second^2
local v_lin = Instance.new("LinearVelocity", blast_clone)
v_lin.Attachment0 = at
v_lin.VectorVelocity = lookVector * velocity
end)
I have tried setting the network ownership of the projectile to the server, as well as making the projectile massless – but evidently neither of these fixed the issue. Can someone please help?