#First Person

67 messages · Page 1 of 1 (latest)

wispy forge
#

I need help with showing body in first person, I try lot of tutorials and forums and they didnt work. I have this script:

local player = game.Players.LocalPlayer
local char = player.Character
local RunService = game:GetService("RunService")

char.Humanoid.CameraOffset = Vector3.new(0, 0, -1)

for i, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "Head" then

v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
v.LocalTransparencyModifier = v.Transparency
end)

v.LocalTransparencyModifier = v.Transparency

end
end

RunService.RenderStepped:Connect(function(step)
local ray = Ray.new(char.Head.Position, ((char.Head.CFrame + char.Head.CFrame.LookVector * 2) - char.Head.Position).Position.Unit)
local ignoreList = char:GetChildren()

local hit, pos = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)

if hit then
char.Humanoid.CameraOffset = Vector3.new(0, 0, -(char.Head.Position - pos).magnitude)
else
char.Humanoid.CameraOffset = Vector3.new(0, 0, -1)
end
end)

sweet acornBOT
#

studio** You are now Level 1! **studio

stable breach
#

Just put the currentcamera to first person ist that easie

wispy forge
#

emm..

stable breach
#

** Here's how you can do it:**

game:GetService("Workspace").CurrentCamera.CameraType = Enum.CameraType.FirstPerson
wispy forge
#

oh that, I did it but I want to see body parts and that dont do it so..

stable breach
#

alr i have an old script of mine il copy it.

stable breach
wispy forge
#

?

#

no, I mean when I am in that first person I can look down and see my body ands legs and that

stable breach
#

maybe something like this

i may have some type wrongs so try to fix that if there is.

local character = game.Players.LocalPlayer.Character
local camera = game:GetService("Workspace").CurrentCamera

camera.CameraType = Enum.CameraType.FirstPerson


local cameraOffset = Vector3.new(0, 2, 0) 
local cameraRotation = Vector3.new(0, 0, 0)  


local function updateCamera()
    camera.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(cameraOffset) * CFrame.Angles(cameraRotation.x, cameraRotation.y, cameraRotation.z)
end

game:GetService("RunService").RenderStepped:Connect(updateCamera)
#

@wispy forge

wispy forge
#

I try

#

still I cant see my body :/

#

like, I can get first person working but cant see my body

stable breach
#

so you want to see your body parts like your hands?

wispy forge
#

yes

stable breach
#

Then you will need some advanced scripting

wispy forge
#

that all I am talking about, or atleast I am rting

#

oh

sweet acornBOT
#

studio** You are now Level 2! **studio

stable breach
#

yes you need 2 hands and 2 legs and a root

#

basically everything you want to see get them first apart

#

I recommend putting your game chars to r6

wispy forge
#

r6.. but it will mess quality of avatars or?

stable breach
#

idk i dont think so it just changes to r6 and makes it easier to handle an character but if you have animations inside an r15 character then dont change to r6

#

You can also change the pov vieuw

wispy forge
#

I dont have anythink yet so ok

stable breach
#

Maybe try first change the pov view

wispy forge
#

nothink

stable breach
#

try this

local camera = game:GetService("Workspace").CurrentCamera
camera.FieldOfView = 70 --adjust
local character = Game.Players.LocalPlayer.Character
local camera = game:GetService("Workspace").CurrentCamera

local head = character:WaitForChild("Head")  
local maxPitchAngle = -70  --adust as needed

local function updateCamera()
    local cameraOffset = Vector3.new(0, 2, 0)
    local cameraRotation = Vector3.new(0, 0, 0)

 
cameraRotation = Vector3.new(-camera.RotX, camera.RotY, camera.RotZ)

if cameraRotation.x < maxPitchAngle then
        head.Transparency = 1 
    else
        head.Transparency = 0  
    end

    camera.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(cameraOffset) * CFrame.Angles(cameraRotation.x, cameraRotation.y, cameraRotation.z)
end

game:GetService("RunService").RenderStepped:Connect(updateCamera)
wispy forge
#

and put it in startercharacterscripts right

stable breach
#

Yes

#

or you can just put it in startergui

wispy forge
#

no... just adjusting fov work, nothink else

#

is my place buged?

stable breach
#

No its not your place

#

Do you get any errors?

wispy forge
#

idk wait

#

yea some errors

stable breach
#

Whay do they say

wispy forge
#

line 12, RotX is not a valid member of camera

stable breach
wispy forge
#

I tryed removing rot, didnt work

stable breach
#
local character = game.Players.LocalPlayer.Character
local camera = game:GetService("Workspace").CurrentCamera

local head = character:WaitForChild("Head")  
local maxPitchAngle = -70  -- Adjust as needed

local function updateCamera()
    local cameraOffset = Vector3.new(0, 2, 0)
    local cameraRotation = Vector3.new(0, 0, 0)

    local cameraCFrame = camera.CFrame
    local cameraLookVector = cameraCFrame.LookVector
    local cameraUpVector = cameraCFrame.UpVector

    cameraRotation = cameraLookVector:ToOrientation()

    if cameraRotation.x < maxPitchAngle then
        head.Transparency = 1 
    else
        head.Transparency = 0  
    end

    camera.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(cameraOffset) * CFrame.Angles(cameraRotation.x, cameraRotation.y, cameraRotation.z)
end

game:GetService("RunService").RenderStepped:Connect(updateCamera)
#

Try that

#

i updated the rots

wispy forge
#

now error on 15 line To0rientation is not a valid member

stable breach
#

Hmmm

#

Maybe using math works

wispy forge
#

math?

stable breach
#
local character = game.Players.LocalPlayer.Character
local camera = game:GetService("Workspace").CurrentCamera

local head = character:WaitForChild("Head")  
local maxPitchAngle = -70  -- Adjust as needed

local function updateCamera()
    local cameraOffset = Vector3.new(0, 2, 0)
    local cameraRotation = Vector3.new(0, 0, 0)

    local cameraCFrame = camera.CFrame
    local cameraLookVector = cameraCFrame.LookVector

    local pitchAngle = math.deg(math.asin(-cameraLookVector.Y))
    cameraRotation = Vector3.new(pitchAngle, math.deg(math.atan2(cameraLookVector.X, cameraLookVector.Z)), 0)

    if pitchAngle < maxPitchAngle then
        head.Transparency = 1 
    else
        head.Transparency = 0  
    end

    camera.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(cameraOffset) * CFrame.Angles(math.rad(cameraRotation.x), math.rad(cameraRotation.y), math.rad(cameraRotation.z))
end

game:GetService("RunService").RenderStepped:Connect(updateCamera)
#

Yes i adedd math

wispy forge
#

I dont think this is how it mind work

#

btw, I need to go on lunch when I come back I look on that if you send somethink

sweet acornBOT
#

studio** You are now Level 3! **studio

wispy forge
#

try send somethink and I will try it later

#

now bye

stable breach
#

My bad i am on my phone so i can't really figure out how to make the chars to see i never worked on that and never tried i only worked on the game

#

But il check some of my games

wispy forge
#

I am back

wispy forge
#

IT WORKS!!!!! I tryed to do it on diferent place and it works!!!!!! Whats wrong with roblox studio?

#

I use this guy script cus it looks prety advanced even have sprint and setting inside