Need help with an aim-down system for my FPS weapon

Hello,

I am trying to make a weapon using “fake arms” on the client when the player is in the first person. I made it all work and now I am trying to implement a aiming system. This is where I am stuck. I use an animation to hold the weapon and I am now trying to figure out how to actually move the weapon to the center of the screen. I tried animation for that of course, but it was not efficient and it didnt line up properly. I then tried to pretty much just set the CFrame of the weapon while the animation ran using this code.

mouse.Button2Down:Connect(function()
	mouse2IsDown = true
	if isEquipped then
		smg.CFrame = camera.CFrame * CFrame.new(0,10,0)
	end
end)

This did not work. I am completly out of ideas and I’ve been researching the dev forum for some hours now and I just don’t know what to do… Any advices of what I should do now would be highly appreciated!

Thank you in advance.

NOTE: The “fake arms” viewModel is an R6 rig while the player itself is R15.

1 Like

I say don’t use animations at all. I am having trouble understanding what you are trying to do though. Can you make a mockup picture of what you are trying to do?

2 Likes

Typing on my phone now, but what I am trying to do is to implement an aim-down system. I have a R6 viewModel parented to workspace.CurrentCamera. the viewModel has just a simple idle animation so it holds the weapon properly. I am trying to add a system so when you click Right mouse button, the weapon move towards the center if the screen and lines up with the iron sight. Using animation to line the sign up, did not work. CFrame did not work either because I think the animation had higher priority. However if I was able to move it with Cframe, the arms would not move with it. I am stuck now and dont know what to do.

2 Likes

Oh right I didn’t even know what an aim down system was before. I say use TweenService to move the gun to the center which takes a minimum of 2 numbers and increases/decreases them gradually within the time specified. TweenService tutorial here: https://www.youtube.com/watch?v=qgGDwTn0zgo

2 Likes

Will that also override the current running animation? And will all Motor6D constraints connected to the weapon I’m tweening also follow the weapon?

What what are you using Motor6D Constraints for?

1 Like

So my weapon mesh is child of the viewModel with a Motor6D between the mesh and the right arm (so i could animate the weapon too)

I don’t think it does. I have tried teleporting the player before and sometimes it doesn’t go successfully but the Motor6D constraints don’t break. Make sure to use CFrame instead of Vector 3 when tweening.

2 Likes

I will see what I can do thank you

1 Like