#1st person mechanism
1 messages · Page 1 of 1 (latest)
What do you mean ? Like a tool ?
No, like how would I make a part not be visible to a player when they're in first person (aka zoomdistance 0.5) but visible anywhere above that
Something like this ?
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local part = workspace.Part
RunService.RenderStepped:Connect(function()
if not player.Character or not player.Character:FindFirstChild("Head") then return end
local head = player.Character.Head
local distance = (camera.CFrame.Position - head.Position).Magnitude
if distance <= 0.5 then
part.LocalTransparencyModifier = 1
else
part.LocalTransparencyModifier = 0
end
end)
This is local btw
I've never used LocalTransparencyModifier, I'll try
Alright, tell me if it work
I guess it does