Hey,
I’m trying to make the character turn towards camera direction wherever I press some key, but when executing this line the character always turn into a constant direction, no matter how I play with the camera.
rootPart.CFrame = CFrame.new(rootPart.Position, camera.CFrame.LookVector.Unit)
also I verified that the lookVector is indeed changing.
Any idea what I’m doing wrong?
local Run = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")
local Camera = workspace.CurrentCamera
local function ManipCamera(Delta)
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(HRP.Position) * CFrame.Angles(0, math.rad(HRP.Orientation.Y), 0) * CFrame.new(0, 4, 8)
end
Run.RenderStepped:Connect(ManipCamera)
This may help.
rootPart.CFrame = CFrame.new(rootPart.Position, camera.Position)