Any idea why projectile curves to the left?

  1. I made a projectile, the intention is that it moves straight from the caster’s humanoid root part at the time of casting.

  2. Well it does the job, however when the part is set free (unanchored) it chooses to move to the left (it also sometimes moves to the right), I assume this is not an issue with the code but with the body velocity. I attached screenshots of the “curve” and as you can see, the projectile when unanchored, is no longer centered. (the body velocity settings are MaxForce 5000,5000,5000, and P 1250)

curve

  1. I have reviewed the code (code below) and I have reviewed the attachments to the projectile, I cannot detect an issue
fireballClone.BodyVelocity.Velocity = (plr.Character.HumanoidRootPart.CFrame.LookVector*100)
local destination1 = Vector3.new(hit.Parent.Torso.Position.X, hit.Parent.Torso.Position.Y , hit.Parent.Torso.Position.Z)
local destination2 = Vector3.new(hit.Parent.Torso.Position.X, hit.Parent.Torso.Position.Y , hit.Parent.Torso.Position.Z)

local Settings1 = {Position = destination1}
local Settings2 = {Position = destination2}

su
here is all things related to the projectile, the scripts can be ignored

This isnt the Correct Category for this

Make sure you put this under #help-and-feedback:scripting-support

i thought i did :skull: :skull::skull::skull::skull::skull::skull::skull::skull::skull::skull::skull::skull: thanks tho

Still is not in #help-and-feedback:scripting-support

Turning CanCollide off and making the part have an anti-gravity force could fix your problem
(You don’t want gravity, right?)
On a side, note, you may want to use LinearVelocity instead. BodyVelocity is deprecated and could be removed at any time.

i switched to linearveloctiy and the problem is fixed, however now it stutters while traveling forward

That’s good, did you check the other thing I mentioned (CanCollide being off?)
This may be why your projectile is stuttering (colliding with the ground).
(As an alternative you could make the projectile spawn a slight bit above the ground so it doesn’t go inside it, in case you need CanCollide)=

cancollide is already off, but here’s the code
it is also massless

			local LV = Instance.new("LinearVelocity", Attachment)
			LV.MaxForce = math.huge 
			LV.VectorVelocity = HRP.CFrame.lookVector * 100 
			LV.Attachment0 = Attachment 
			game.Debris:AddItem(fireballClone, 15)

It might be MaxForce = math.huge. I’ve seen 1e9 for max force works, maybe that could (somehow) fix your problem? (Also you may not want it to be massless. If this is an issue, as in it’s not going as fast as you want multiply your current calculation for vectorvelocity by attachment.Parent)

i have tried both solutions presented, still has a stutter for both

realistically, i believe the problem is within my linearvelocity code implementation somehow

Could I see the whole code for the projectile? I could try to find what the problem is

        local fireballClone = fireball:Clone()
		fireballClone.Parent = game.Workspace
		local offset = Vector3.new(0,-6,-4.5)
		fireballClone.CFrame = plr.Character.HumanoidRootPart.CFrame*CFrame.new(offset)


		local Attachment = Instance.new("Attachment", fireballClone)

		local LV = Instance.new("LinearVelocity", Attachment)
		LV.MaxForce = math.huge
		LV.VectorVelocity = HRP.CFrame.lookVector * 100 
		LV.Attachment0 = Attachment 
		game.Debris:AddItem(fireballClone, 15)
		TouchedConnection = fireballClone.Touched:Connect(function(hit)

below is the dragon’s code, it does not affect the stutter, i have tried deleting it (the dragon starts as anchored and once it’s in position it become unanchored, a projectile going straight forward

local rise = true
local part = script.Parent
local count = 0
while rise do
wait()
part.Position = script.Parent.Position + Vector3.new(0,0.25,0)
count+= 1
if count == 20 then
rise = false
end
end
if rise == false then
part.Anchored = false
end

Try to set LV’s parent after all the values have been set (not using the second parameter), and setting its parent to fireballClone.
This both helps optimization for client-server communication and, I don’t think that LinearVelocity is meant to be put in an attachment.
Also, maybe try setting Attachment’s position to fireballClone.AssemblyCenterOfMass

the tutorial i watched said linear velocity needed an attchment (this is my first time using linear and not body)

Yes, LinearVelocity does need an attachment.
However, LinearVelocity does not need its parent to be the attachment, only the Attachment0 (and Attachment1 for some constraints, but don’t worry about that for LinearVelocity) property.

this is the updated code i made, nothing changed

||||local Attachment = Instance.new(Attachment)|
|---|---|---|---|
||||local LV = Instance.new(LinearVelocity)|
||||LV.MaxForce = math.huge|
||||LV.VectorVelocity = HRP.CFrame.lookVector * 100 |
||||LV.Attachment0 = Attachment |
||||Attachment.Parent = fireballClone|
||||LV.Parent = Attachment|
||||game.Debris:AddItem(fireballClone, 15)|
local Attachment = Instance.new("Attachment")
Attachment.Position = fireballClone.AssemblyCenterOfMass
local LV = Instance.new("LinearVelocity")
LV.MaxForce = 1e9
LV.VectorVelocity = HRP.CFrame.lookVector * 100
LV.Attachment0 = Attachment
Attachment.Parent = fireballClone
LV.Parent = fireballClone
game.Debris:AddItem(fireballClone, 15)

Updated code adding some of the things I mentioned earlier that might help