I'm trying to make a floating object part
in front of the player using the camera's CFrame. Note: I cannot only use an offset from the camera, because I want the floating object to appear flat and as if it were facing the camera directly, this cannot be achieved without using the LookAt
parameter of CFrame.new()
Code:
local RunService = game:GetService("RunService") local LocalPlayer = game:GetService("Players").LocalPlayer local myCamera = workspace.CurrentCamera local part = Instance.new("Part") part.Anchored = true part.CanCollide = false part.Parent = workspace RunService.RenderStepped:Connect(function() local p = myCamera.CFrame.Position+(myCamera.CFrame.LookVector*10)-(myCamera.CFrame.RightVector*8) part.CFrame = CFrame.new(p,myCamera.CFrame.Position) end)
How can I stop the object from rotating in the manner showed in this GIF ?