For the camera follow of player rebirth ??
1 Like
local newCF = CFrame.lookAt(center.Position
+ math.sin(angle) * Vector3.zAxis * radius
+ math.cos(angle) * Vector3.xAxis * radius,
center.Position) * CFrame.new(0, CurrentPlayer.Head.Position, 0)
1 Like
What you’re doing in this code is adding the current player’s head position to the rotating camera, which will put the camera way off of where it should be.
First do your extra math in a second line of code so it’s easier to follow.
-- Seperate the math into different lines of code
local newCF = CFrame.lookAt(center.Position
+ math.sin(angle) * Vector3.zAxis * radius
+ math.cos(angle) * Vector3.xAxis * radius,
center.Position)
newCF *= CFrame.new(0, positionOfHead.Y, 0)
You are adding the distance between the player’s head and the ground to the camera that is already near the player, so the camera will shoot up into the sky! Add the difference between the newCF position and the head position instead:
-- Replace the second line with:
newCF *= CFrame.new(0, positionOfHead.Y - newCF.Position.Y, 0)
3 Likes
Thanks for the solution man really appreciated
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.