How does Phantom forces do arm view bobbing?

It still snaps back to the camera when you stop moving!

Script:

local t = 0
wait(2)

game.ReplicatedStorage:WaitForChild("ViewModel").Parent = workspace.CurrentCamera

game:GetService("RunService").RenderStepped:Connect(function(dt)
	if game.Players.LocalPlayer.Character.Humanoid.MoveDirection.Magnitude > 0 then
		local x = math.sin(t * 5) * 0.25
		local y = math.abs(math.sin(t * 5)) * 0.25
		
		local cf = CFrame.new(x, y, 0)
		workspace.CurrentCamera.ViewModel:SetPrimaryPartCFrame(workspace.CurrentCamera.CFrame * cf)
	else
		workspace.CurrentCamera.ViewModel:SetPrimaryPartCFrame(workspace.CurrentCamera.CFrame)
	end
	t += dt
end)

You need to lerp back to the original position when you stop moving.

However, what alpha percentage would I use for the second argument?

you havenā€™t checked youtube yet right?

next time please check youtube

next time please read the thread

and the title too, says arm view bobbing, not camera bobbing

I see what you want now

try making a custom animation in blender with the arm bobbing

cause Iā€™m pretty sure thatā€™s how they do it

I dont think theres a way to do arm bobbing with scripting

correct if Iā€™m wrong I forget some things some times

Hi, considering you were banned on our game with definitive evidence for ā€œSilent aimbotā€ I donā€™t agree with giving you our formula or any other internal info on how PF works.
A potential outlook of this is you trying to figure out how the formula works to remove gun sway to gain an advantage, as projectiles are casted out of the actual gun barrels position.

13 Likes

Guy above me is pretty rude.
Thank Ego moose for this code

I wanted to learn how to make my own game, but since you are like that and assume my intentions, I suppose I will take matters into my own hands. What Iā€™m going to do Iā€™ll leave as food for thought :wink:

I donā€™t know why anyone would give you a formula of there game internals, just make your own? Unless if your doing this for malicous purposes I donā€™t see the point of this.

This is a bit off topic, but can I ask how you obtained that code?

That could just be a generic free model, so I wouldnā€™t fully believe it to be the one used by PF.

I was also asking the developers in Discord about the subject and showed them code snip, they responded with not a 100% copy but its there outdated methods.

Leads me to believe this was there old way of doing it.

Please follow the guidelines when posting: About the Scripting Support category