So I’m trying to make this turret face towards the player, but when you move around it comes off the original positioning that I was hoping for.
I think you’ll need to show us your scripts lol
nevermind it could be because your code has the model spin from the centerpoint which is at the base of the barrel, so whats happening is the turret follows you but it pivots from the base of the barrel making it look like its moved off the original position.
To fix this, move the turret head backwards so that the centerpoint aligns with the center of your turrets base.
local ShootingPart = script.Parent.Shooter
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.CharacterAdded:Wait()
while true do
ShootingPart.CFrame = CFrame.new(ShootingPart.Position, char.HumanoidRootPart.Position) * CFrame.Angles(math.rad(0), math.rad(-90), math.rad(0))
wait()
end
end)
The problem is, this way it will make it look really stupid
put the turret head into a model called turrethead, make an invisible part called pivotPoint inside the model on the desired pivot point for the turret head, set pivotPoint to the models PrimaryPart. Then try changing the turret head models PrimaryPart.CFrame instead? Id try writing a script for you to do this but my mouse is doing a naughty naughty and not responding so unfortunately i cannot and youll have to do it yourself
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.