Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need tips on what to research for a Gun zoom?

I am making a third person shooter game, and I wanted to know some tips on what to research about a zoom system. Example say your character is just walking around with the gun the default cam and when you press q or rightmouse click your character holds up the gun like there aiming then you see a cross hair. Does anyone have any tips on how to do this or were to learn.

2 answers

✓ Accepted answer

For the zooming itself, the simplest way is to just decrease the Field of View:

LocalScript in Tool

local camera = workspace.CurrentCamera -- get the camera
camera.FieldOfView = 50 -- (default 70) makes you zoom in

As for raising your arms, you'll want to use an animation. Here's the relevant page from the wiki: http://wiki.roblox.com/index.php?title=Animations

And for having this all happen when you perform an action, check out the UserInputService: http://wiki.roblox.com/index.php?title=API:Class/UserInputService

1 comment

0

THANK YOU SO MUCH! This is is what im looking for thanks again i appricate this!

Well for the zoom you can slowly change the field of view.

local camera = game.Workspace.CurrentCamera
local fov = camera.FieldOfView

function aim()
	repeat fov = fov - 1
		wait(0.1)
	until fov = 40
end

script.Parent.Mouse3Down:connect(aim)

for the arms moving, depending on the player type(R15 or R6) you can use animations or CFrame.

This discussion is preserved as it was. New answers, comments, and votes are closed.