Thats really strange its not rotating correctly then, the shooting direction is based off of the look direction of the spear, and if its shooting in the correct direction, that must mean that its also looking in the correct direction, but its obviously not
This is obviously not going to fix it, but the only thing i can think of is replacing CFrame.new() with CFrame.lookAt() because that does a better job of what you are trying to do
Okay! So, turns out, I mis-understood your question. You don’t actually need a BodyGyro
to achieve what you’re looking for, I tried it out and it automatically put the front face facing towards the direction it was moving. This makes me think that the model/mesh is actually backwards, so what you can try to do to fix this is add a
to the line before where you set the spear’s parent to the workspace. Works for me, but I’ll link my code just in case.
local player = game:GetService("Players").LocalPlayer;
local mouse = player:GetMouse();
local character = player.Character;
while true do
if character then
break
end
character = player.Character
wait()
end
wait(5)
local spear = script.ThrowingSpear:Clone()
spear.CanCollide = false;
spear.Anchored = false;
spear.Parent = game:GetService("Workspace")
local velocity = Instance.new("BodyVelocity")
velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
velocity.Parent = spear
-- Doing this in r15 so changed "character.Torso" to "character.HumanoidRootPart"!
local cframe = character.HumanoidRootPart.CFrame * CFrame.new(6, 0, 0)
spear.CFrame = CFrame.new(cframe.Position, mouse.Hit.p)
velocity.Velocity = spear.CFrame.lookVector * 50
spear.CFrame = spear.CFrame * CFrame.Angles(math.rad(-180), 0, 0)
spear.Parent = game.Workspace
spear.PlayerName.Value = player.Name
game.Debris:AddItem(spear, 5)
return;
Hope this helps, also I did this on a localscript for the sake of simplicity, but shouldn’t be too hard to hook it up to a RemoteFunction or RemoteEvent! Hope this helps!