Making camera like Hellmet

Here is the r15 script
Please try this and tell me quick :sob:


repeat task.wait() until game:IsLoaded()

local camera = game.Workspace.Camera

local Players = game:GetService("Players")

local Rs = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local CS = game:GetService("ContextActionService")

local Player = Players.LocalPlayer
local Charecter:Model = Player.Character
local Head:Part = Charecter:WaitForChild("Head")
local Torso:Part = Charecter:WaitForChild("UpperTorso")
local Neck:Motor6D = Head:WaitForChild("Neck")
local Humanoid:Humanoid = Charecter:WaitForChild("Humanoid")
local HumanoidRootPart:Part = Charecter:WaitForChild("HumanoidRootPart")
local Mouse = Player:GetMouse()

Humanoid.AutoRotate = false

local Dead = false


camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 120



local Offfset = 1.2 --Mess With this value the more you add to this number it becomes oriented to the right if negative oriented to the left
local currentxoffset = Offfset

local HelmetPositonLoop
local InputConnection
local MouseConneciton

HelmetPositonLoop = Rs.RenderStepped:Connect(function()

	camera.CFrame = (Head.CFrame * CFrame.new(Vector3.new(currentxoffset, 0.5, 0.6)))
	UIS.MouseBehavior = Enum.MouseBehavior.LockCenter


end)

local CurrentXDelta = 0
local CurrentYDelta = 0
local NeckCahce = Neck.C0
function MouseMoved(actionName:string, inputState, inputObject:InputObject)

	local Neckc0Store:CFrame = Neck.C0

	local CompressedDelta:Vector2 = Vector2.new(inputObject.Delta.X,inputObject.Delta.Y)

	CurrentXDelta = CompressedDelta.X
	CurrentYDelta = CompressedDelta.Y

	HumanoidRootPart.CFrame = HumanoidRootPart.CFrame:Lerp(HumanoidRootPart.CFrame * CFrame.Angles(0, -math.rad(CurrentXDelta/2), 0),1) 	

	local RotationX, RotationY, RotationZ = Neckc0Store:ToEulerAnglesXYZ()

	local NewRotX =    math.deg(RotationX+ -CurrentYDelta/200)



	NewRotX = math.clamp(NewRotX,-85,65)

	Neck.C0 = Neck.C0:Lerp(CFrame.new(Neckc0Store.Position)*CFrame.Angles(math.rad(NewRotX),RotationY,RotationZ),1) 




end

MouseConneciton = CS:BindAction("MouseMoved",MouseMoved,false,Enum.UserInputType.MouseMovement)

InputConnection = UIS.InputBegan:Connect(function(input:InputObject,GPE:boolean)

	if GPE then return end

	local Keycode = input.KeyCode


	if Keycode == Enum.KeyCode.Q and currentxoffset ~= -Offfset then

		currentxoffset = -Offfset
	end
	if Keycode == Enum.KeyCode.E and currentxoffset ~= math.abs(Offfset) then
		currentxoffset = math.abs(Offfset)

	end
	--print(currentxoffset)

end)

Humanoid.Died:Connect(function()
	if Dead == true then return end

	Dead = true
	InputConnection:Disconnect()

	CS:UnbindAction("MouseMoved")

	task.wait(Players.RespawnTime)

	HelmetPositonLoop:Disconnect()

end)

Real qucik if this one dosnt work send me a screenshot of the explorer when the project is ran and when the project is not ran to see if acs has named things to different names

Where do I put this? I need to know where so I know where it is supposed to be.

Edited: Nevermind, now I know where to put it! :slight_smile:

Which ragdoll script is this one? I want to make sure I find the right one!

Its a custom script any script works with it Except for ones that delete the character

2 Likes

Thanks for telling me about it! I tested it with one of the ragdolls with the toolbox, and this time, it works, even though the head shakes a lot lol! One more thing! How can I make it so the arms can also move as well? Much like the new Roblox game Hellmet!

try looking into this

1 Like

Hellmet puts a view model with a offset on the head to make it looks like its on the torso

This is offseted from the head:


This has no offset:

You probably notice the difference
heres a snippet of the code thatt makes this possible

GunCframe = (headcf) * CFrame.new(gunoffset)*CFrame.Angles(math.rad(math.clamp(FakeMousePosOnScreenY,-5,5) ),math.rad(math.clamp(FakeMousePosOnScreenX,-5,5)),0)

This can be seperated into two seperate parts
Code that handles the offset

GunCframe = (headcf) * CFrame.new(gunoffset)

Code that handles the fake mouse position

CFrame.Angles(math.rad(math.clamp(FakeMousePosOnScreenY,-5,5) ),math.rad(math.clamp(FakeMousePosOnScreenX,-5,5)),0)

When both are put together they add the permenant sway
Link to the reference

Fakemouse variables are the mouse deltas that are saved in two seperate variables i reccomend you save it in a vector 2 but both work flawlessley Also like @clvmbrew Had said the springy sway is the one hellmet has when you move and it makes a little rebound!
Sorry for any spelling english is not my primary. Good day :slight_smile:

1 Like

That’s nice. So it’s a ViewModel but the Offset moves it down to make it look like it in the torso. So how can I do that? I just want to know how.

1 Like

Headcframe * cframe.new(vector3.new(0,-5,0)) --random numbers
Tahts the basics of it
Get the cframe of the head multiply it by a cframe.new
inside that cframe.new
Put a new vector3
and inside label the offset you want based off the x y z
If you got any other question then ask away

There should be a tutorial out there on YouTube, right? So that way I see what it looks like.

2 Likes

Yeah search a uhh viewmodel toutoiral and then learn the basics then add the offset with the vector 3 nested in the cframe

2 Likes

I also do wonder. How does the arms even move? Does it make the third-person arms invisible and the ViewModel arms visible instead?

1 Like

Yeah you just make the viewmodel appear and the arms invisble.
When you “Unequip” in game it deletes the viewmodel and makes the arms visible

2 Likes


old video but i managed to pull it off

1 Like

I think I might be able to pull it off. There is a script that a favorite creator I like, who also made the FE Gun Kit, shows your arms in first person and moves very smoothly like sway arms kind of, and he also made the updated/current FE Gun Kit to have a ViewModel for 3rd person, so yeah, I might be able to do it! Thanks for some tips, and massive thanks for the script! You are the best!

im going to overhaul this resource gonna make it more smoother and more customizable

Don’t think this is a normal thing?

Edit: This only happens in studio.

Might be a studio bug i have no idea they have been releasing alot of updates but if it works ingame and its just in studio than its just a studio bug i just repeated myself :sob:

1 Like

but if your using the newer resource mess with the uhh offset value

1 Like