Basically I am working on a lock on system for flight combat in a dragon ball game. The system is very simple yet for one game it is broken and for another it works just fine. The scripts are identical, so I’m assuming its some setting but basically the player’s head is always facing opposite the camera for some reason.
https://gyazo.com/ff65193b50e925d8d2a8c692d1a4b22e
Here is a video of what is happening in my testing place. And here is what it is supposed to look like in my game:
https://gyazo.com/a65e7b9cfcc5368d80b7c0c5b1d0a363
If anybody has any ideas PLEASE let me know. I’ve been trying to figure it out for about a day.
RunService.Heartbeat:Connect(function()
if LockOnTarget ~= nil and Character and Character.PrimaryPart and Character.Humanoid and (Character.PrimaryPart.Position-LockOnTarget.PrimaryPart.Position).magnitude < 2500 and LockOnTarget.Humanoid and LockOnTarget.Humanoid .Health > 0 then
local CamPos = CFrame.new(Character.PrimaryPart.Position, LockOnTarget.PrimaryPart.Position)*CFrame.new(0,4,9).p
CameraBodyPosition.Position = CamPos
workspace.CurrentCamera.CameraType = "Scriptable"
workspace.CurrentCamera.CFrame = CFrame.new(CamBlock.Position, LockOnTarget.PrimaryPart.Position)
local Dist = (Character.PrimaryPart.Position- LockOnTarget.PrimaryPart.Position).magnitude
ImageLayover.ImageTransparency = 1-(Dist/80)
if flying == true then
Character.Humanoid.PlatformStand = true
Character.Humanoid.AutoRotate = false
-- Character:SetPrimaryPartCFrame(CFrame.fromMatrix(Character.PrimaryPart.Position, Vector3.new( LockOnTarget.PrimaryPart.Position.X, LockOnTarget.PrimaryPart.Position.Y, LockOnTarget.PrimaryPart.Position.Z) ))
Character:SetPrimaryPartCFrame(CFrame.lookAt(Character.PrimaryPart.Position, Vector3.new( LockOnTarget.PrimaryPart.Position.X, LockOnTarget.PrimaryPart.Position.Y, LockOnTarget.PrimaryPart.Position.Z) ))
Character.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0,0,0)
else
Character.Humanoid.AutoRotate = true
Character.Humanoid.PlatformStand = false
end
else
if LockOnTarget ~= nil and LockOnTarget.Humanoid.Health <= 0 then
workspace.CurrentCamera.CameraType = "Custom"
else
workspace.CurrentCamera.CameraType = "Custom"
end
Character.Humanoid.PlatformStand = false
Character.Humanoid.AutoRotate = true
end
end)