I’m trying to make a projectile (dagger model) move forward and time it to fire with an animation. I’m using a linearvelocity parented to the primarypart of the model, and after a specific duration I use setprimarypartcframe (I was using pivotto before but I didn’t notice an apparent difference after the change ) and set the vectorvelocity of the linearvelocity
BUT (as seen in the slowed-down video below) even though the model cframe is set at the same time as the velocity, the dagger doesn’t move until a short delay later after its been positioned. I was using a bodyvelocity earlier but it had the same delay as the linearvelocity (which didn’t fix this issue…)
(the dagger model is completely unanchored before the velocity is applied btw)
this is the code that sets the cframe and velocity (very messy sorry)
if not shiftlocked then
direction = (pos - HRP.Position).Unit
chip:SetPrimaryPartCFrame(CFrame.new(HRP.Position, pos)*CFrame.Angles(0,math.rad(180),0))
else
local result = workspace:Raycast(HRP.Position-Vector3.new(0,2.1,0), HRP.CFrame.LookVector*75, raycastParams)
local resultpos
if result and result.Instance:FindFirstAncestorWhichIsA("Model") and result.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") then
resultpos = result.Position
else
resultpos = HRP.Position+HRP.CFrame.LookVector
end
chip:SetPrimaryPartCFrame(CFrame.new(HRP.Position, resultpos)*CFrame.Angles(0,math.rad(180),0))
direction = (resultpos - HRP.Position).Unit
end
linearVelocity.VectorVelocity = direction * 120
if its the linearvelocity’s fault for delaying after the velocity is set, are there any alternatives? and if it’s the cframe-setting function’s fault for like preventing movement or something, are there alternatives for that?