ADS View looks bad

Hello!
I made an ADS System, but the aim looks bad and very unaccurate.
I used animations and tween camera field of view
I am very bad at math, so used animations.

Thanks to @codelead for camera tween

Anyone knows how do I make it look better?

4 Likes

This is moreso an animation problem. The aim is slightly off from the middle, perhaps reanimating it to where it is supposed to be would be the solution. The
aim is actually very accurate, can you explain how you believe it isnt?

2 Likes

So, when while aiming and moving camera down.
I cant see what i am aiming at

You wanna me link the game, and see yourself?

Mind providing code so we can see how you move the arms/gun in the specified direction?


You can see your self
Ignore the bad animations and a lot of things, is just testing

I can see the problem in the video, we need what you use to look around and your arms follow you as theres code thats causing this.

Okay, there!

local Right_Shoulder = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
local Left_Shoulder = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)

game:GetService("RunService").RenderStepped:Connect(function()
	if equipped and char.Humanoid.WalkSpeed < 20 then
		char.Torso["Right Shoulder"].C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).Unit.Y), 1.55, 0)
		char.Torso["Left Shoulder"].C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).Unit.Y), -1.55, 0)
		char.Torso.CFrame = CFrame.new(char.Torso.Position, Vector3.new(mouse.Hit.p.X, char.Torso.Position.Y, mouse.Hit.p.Z))
	else
		return
	end
end)

First of all, please don’t simply ask “how can I make this look better”, as that’s more of a design question. Please know exactly what you want to happen before asking in this category. We can only give a stab in the dark with vague questions with little info.

I can see a few things that make the aim look bad. First of all, the mouse cursor. Try hiding the cursor with UserInputService.MouseIconEnabled.

Secondly, make sure that the animation puts the aim at the exact center of the viewport. At the moment, it seems to be off slightly. This is the reason animations are not suitable if you want accurate aims.

If you want it to be truly in the center, forget animations and use tween service (info here) to tween the parts of the gun to the correct spot, which you can use properly.

Finally, there’s some code cleanup you should do. First of all, you declare two CFrames that are never used. You can take them out, unless you really need them later. Secondly, getting a service on a single line (like this game:GetService("RunService").RenderStepped) leads to messy code. Declare it as a separate variable above. Finally, you have an else statement that returns nothing for no reason. Remove the else statement, and the return along with it. A function returns on its own once you reach the end.

1 Like

toObjectSpace math. Get the offset from the arm to the sight, then the offset from the arm to the camera.

The ony animations i would use for FPS games is reload animations, and even then, I made my own animation editor to use CFrame for it.