Hey, i was playing untitled tag game, and if you dont know theres like some kind of rolling and sliding but when you preform one of those the camera follows the head (also with emotes)
here is some clips:
(sorry for the lag, my pc is a potato lol)
so i by far looked for something like that, but everything i found didnt let me move my camera, so any help is appreciated!
i think op wants the angle to be tilted the way the head tilts but also to have freedom to look around. maybe restrain the cam during events where it moves?
ohh, thats a good idea ngl, but to be quick, i just wanna change the orientation of the camera to the head’s orientation, but i only saw cam.CFrame:ToEulerAnglesXYZ() and idk how to implement that or what is even that, ill check if what u did works, thx!
local p = game.Players.LocalPlayer
local c = p.Character or p.CharacterAdded:Wait()
local cam = game.Workspace.CurrentCamera
local m = p:GetMouse()
cam.FieldOfView = 80
--- Hide the player's accessories in first person, or they will cover our screen!
local doCamAttatch = false
local currentCamCframe = cam.CFrame
game.ReplicatedStorage.AttachCamToHead.Event:Connect(function()
currentCamCframe = cam.CFrame
doCamAttatch = true
c.Humanoid.AutoRotate = false
for i,v in pairs(c:GetChildren()) do
if v:IsA("Accessory") then
v.Handle.Transparency = 1
end
end
end)
game.ReplicatedStorage.UnAttachCamToHead.Event:Connect(function()
cam.CFrame = currentCamCframe
doCamAttatch = false
c.Humanoid.AutoRotate = true
for i,v in pairs(c:GetChildren()) do
if v:IsA("Accessory") then
v.Handle.Transparency = 0
end
end
end)
game["Run Service"].RenderStepped:Connect(function()
if doCamAttatch then
if c and c:FindFirstChild("Head") then
local mouse_position = Vector2.new(m.X,m.Y)
---- Calculate how far from the centre of the screen the player's mouse is
local screen_size = cam.ViewportSize
local mouse_centre_offset = (mouse_position/screen_size)-Vector2.new(0.5,0.5)
local mouse_camera_rotation = CFrame.Angles(-mouse_centre_offset.Y,-mouse_centre_offset.X,0)
cam.CFrame = c.Head.CFrame*CFrame.new(0,0.25,-0.375)*mouse_camera_rotation
end
end
end)
(and the 2 bindableEvents) anyways tysm! have a great day!