First person animations in-game

Hey, I need help with animations in game.

Is there any possible way to make a first person animation(i got anything ready such as seeing own body but not the first person lock)?

I tried an endless loop

	repeat
		cam.CFrame = script.Parent:FindFirstChild("Head").CFrame
		task.wait()
		print'repeat'
	until false

to see if it would help but making the camera locked to the head made the character spin insanely.

Any help will be really appreciated.

7 Likes

reply to make the post go into someone’s latest section

1 Like

did the entire forum die? damn

1 Like

Seriously though, someone please respond. At least say it’s impossible or something, please!

2 Likes

Hello!! I got some solution thing, i am gonna say it in an different reply because i first need to test it out.

2 Likes

So i have made an quick script that should be the solution!

local char = script.Parent

local head = char:WaitForChild(“Head”)

local cam = Instance.new(“Part”)
cam.Size = Vector3.new(1.5,1.5,1.5)
cam.Parent = char
cam.Transparency = 1
cam.Anchored = false
cam.CanCollide = false

cam.CFrame = head.CFrame

local weld = Instance.new(“WeldConstraint”)
weld.Part0 = cam
weld.Part1 = head
weld.Parent = cam

NOTE, that the part (cam) i have made it in an instance. U probaly made an different part in workspace
So just do

local cam = …

And make sure u make
canCollide = false
Anchored = false
and i made the size = vector3.new(1.5,1.5,1.5)

QUICK EDIT, make this script in starterCharacterScripts. So the script.Parent = char works

Oki that’s it :smiley:

1 Like

Please dont bump your forum post up please.

This post is already up for 40 minutes /: so i get it for him, but i would not really say it like that out loud :monkey_face:
(The thing he said i mean (Firtina001))

I get it, it is a bad thing to bump but I really did need help asap. Sorry for bothering.

1 Like

I get it :slight_smile: but like just a quick note. The script i made is Server-Script, not local.

1 Like

I tried to do everything you said but again the character started spinning intensely.
It’s supposed to look like this but

in first person it’s just this

sorry, the first video is corrupted

1 Like

That could be some problem in the animation handling i think.
I got an new idea! U could weld it to the torso of an player (HumanoidRootPart)
And just put the position to the head. U could try that

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, 2.5, -1.5)
end

Run.RenderStepped:Connect(ManipCamera)

Exactly what i said, so i think it shold work :smiley: thanks Forummer xD really an quincidinse. Well not exactly but the same idea :slight_smile:

ookay umm…


the character spins even worse now…

The script essentially just sets the camera to first person mode, I’m not sure how you’ve attempted to use it.

I think I am supposed to put that script into anywhere that can run localscripts right?

I really don’t know, I just really suck at coding…

With the help of NotSpideeyDev I made this

	cam.CameraType = Enum.CameraType.Scriptable
	cam.CameraSubject = campart

	repeat
		task.wait()
		cam.CFrame = campart.CFrame
		load.Stopped:Connect(function() playing = false end)
	until not playing

	cam.CameraSubject = script.Parent.Humanoid
	cam.CameraType = Enum.CameraType.Custom
	cam.CFrame = script.Parent.Head.CFrame

campart is a part created by a serverside script. load is the animation itself. playing is a boolean to see if the animation is playing. I used a repeat loop to set the CFrame of the camera to the camera part until the animation stopped. I think the problem was the CameraSubject. Thanks, everyone, for your help.

3 Likes