How can i add First Person Aiming without ViewModel?

Soo i decided to make both Third and First person gun system, firstly i made it based on ViewModels, but i understood it’s not that good aproach for my game, soo i decided to make third person guns, but problem is that in first person idk how to implement aiming similar to FPS but without ViewModel, any ideas?

4 Likes

you would have to make an animation for the arms,
then zoom in with the camera (change field of view or something else)

3 Likes

Ok, i have one more question, is setting camera offset in first person good idea? because i could set it to Aim Part’s position relative to Head or smth and achieve similar effect

This is a tutorial about creating FPS Systems, in this part exactly, you would know how to create aim (Aiming is step 6)

1 Like

The problem is that i’ll use Third Person Arms in First person, this is why i can’t Lerp them to Aim Part

I have been summoned and I am happy.

I would explain the entire process but as I am a bit occupied, here is my code:

	if tool then
		local leftGunOffset = CFrame.identity
		local rightGunOffset = CFrame.identity

		local arbitrary_tTC = Torso.CFrame:ToObjectSpace(CFrame.new(Camera.CFrame.Position)*actualCameraCFrame*CFrame.new(leaning * shoulder,-1.5,0))
		torsoToCamera = torsoToCamera:Lerp(arbitrary_tTC,10*deltaTime)

		leftShoulder_Offset = leftShoulder_Offset:Lerp(CFrame.new(-0.2,-0.15, 0),8*deltaTime)
		rightShoulder_Offset = rightShoulder_Offset:Lerp(CFrame.new(0.2, -0.15, 0),8*deltaTime)

		leftShoulderC0 = torsoToCamera*LeftShoulderC0*leftShoulder_Offset
		rightShoulderC0 = torsoToCamera*RightShoulderC0*rightShoulder_Offset
	end
	
	LeftShoulder.C0 = leftShoulderC0
	RightShoulder.C0 = rightShoulderC0

This basically moves the arms to the camera of the player.

1 Like

isn’t this exactly what you don’t want for third person arms?
unless the complicated math you’ve sent makes it look proper

i thought you’d only want arms on the camera for viewmodels

OP is asking for a view model. The only logical sense would make them want arms to appear in first person without the need to make a separate rig. There are other ways of achieving this in third person.

And
No I am not always lurking in the forums if you wonder.

1 Like

I’m asking how to make ADS without ViewModel, problem is that idk how to do it, only logical solution for now is to change camera CFrame to AimPart’s position

The solution for aim in the first person (Perhaps my decision will seem strange, but I will still express my decision.):

:warning:I do not know English well, so I write through an online translator. Sorry for the terrible translation!
:warning:To understand my meaning, you need to know a little geometry.

  1. So, we have a sighting part inside the pistol model. Let’s consider this a kind of “A” point. Let’s not forget to take into account that the player’s camera can also represent a certain point. Let’s call her C. Suppose that the only “alpha” plane passes through point A, but this plane does not intersect point C.

  2. Draw a straight line that will intersect the Alpha plane. Let’s call it CM (the intersection point will be called M). Then we see that M, like A, lies in the alpha plane. So we have the right to find projections on the X and Y axes or Z and Y (no difference).

  3. Now, knowing the projections of the two directions, we will change the CFrame of the hands of the Motor6D. (It is important to take into account that all vectors lie in the alpha plane. Otherwise, the hands may go in the wrong direction).

I hope that my decision will be correct

1 Like

Oo… that’s a bit more complicated.

I don’t have the script so here is a basic explanation.


So if the pink arrow represents our aim sight and the red one is our camera location then we move the pink arrow to align with the red arrow. We do this by doing something like:

armC0 = (armPosition - cameraPosition) - (armPosition - aimSightPosition)

Where armPosition is just the Torso.CFrame*RightShoulder_OriginalC0.

This is the formula IIRC. If it doesn’t work then I am sorry.

1 Like

In fact, you shortened my solution to this problem by specifying the formula in roblox studio

problem is that i don’t use view model soo i can’t simply move arms, i need something different, i’ll try changing camera’s CFrame to AimPoint’s position

Inside the Torso there is a Motor6D of your hands. You just need to make a script that will change the CFrame of the Motor6D hands.

so how do you want to add ADS without the use of arms??

i am very confused :frowning:

problem is that it’s also present in third person, my overall idea was to teleport camera to aim part’s CFrame, but it requires me to set camera type to scriptable

so animate (or use the complicated ahh code @awry_y sent (i still do not understand it)) the arms in third person

can’t you just do;

local rService = game:GetService("RunService")

rService:BindToRenderStep("Something", Enum.RenderPriority.Camera.Value, function()
   -- weld the camera to the aimpart or whatever
end)

Why not? You are moving the characters arms and not some other models arms.

It is rude for you to call my simple code complicated. It literally just took me a year of trial and error. Nothing much. (I kind of mastered cframes ish.)

As i said, i use character arms as Third Person Model too, which mean i can’t move them because it will look weird with animation and stuff, View Models failed my needs, soo the only thing i’m left is camera

Then why not switch between the two? If the camera is in first person then use the first person code but if it’s not then use the third person code.