why are you only using the Z component? the acceleration in CastBehavior is independent from the direction of the cast, so it’s only ever going to accelerate on the world Z axis.
huh. as long as your acceleration is pos1 - pos2 and initial velocity is pos2 - pos1 then your acceleration is good. there’s a chance that either you’re multiplying one of them with a negative number, or the magnitude of your acceleration is too low/high. try setting the magnitude of the acceleration to be the same as the initial speed; it should come to rest after exactly 1 second.
Senor = function(Tower, Target)
local lvp = Target.Position.Position
local cf = CFrame.lookAt(Tower.Position, Vector3.new(lvp.X, Tower.Position.Y, lvp.Z))
local t = towers[Tower]
local se = t.ProjectileSettings
local offsets = {
cf * CFrame.new(0.2,0.7,0);
}
local rp = se[3]
local b = se[2]
rp.FilterDescendantsInstances = {workspace}
rp.FilterType = Enum.RaycastFilterType.Blacklist
local pos1 = offsets[1].Position
local pos2 = offsets[1].Position + offsets[1].LookVector * Tower:GetAttribute("Distance")
local calc = (pos1 - pos2).Magnitude
local acceleration = pos1 - pos2
local velocity = pos2 - pos1
b.Acceleration = acceleration
b.RaycastParams = rp
TC:FireAllClients("Anim", Tower, "Shoot")
local cast = td:Fire(Tower, offsets[1].Position, offsets[1].LookVector * Tower:GetAttribute("Distance"), velocity, banana)
task.delay(calc/2, function()
if not cast then return end
if not cast.Terminate then return end
cast:Terminate()
end)
end,
there’s your issue, you’re not using the velocity. inside td:Fire() you want to replace offsets[1].Position with velocity, because the second argument is the direction it goes initially. I also believe you want to replace Tower with offsets[1] if that’s where it’s shooting from.
additionally in FastCast the third argument is a number not Vector3, so remove the LookVector *.