- Home /
FPS Gun Recoil (Accuracy)
Hey I need a little bit of help with improving my Gun Accuracy - System.
My gun already is innaccurate noscoped, gets more innaccurate when rapid fired and when scoped it's more accurate and when you shoot the Gun kicks upwards(Camera rotates). Now what I want to implement that when you shoot the gun not only kick upwards but also to the left and right randomly as seen in nearly every modern FPS or in the Dastardly Bananas new FPS Constructor Web Demo : Link to Web Demo
I downloaded the latest free version of the FPS Constructur to have a look at the code but it seems that it wasn't implemented yet in 0.95 .
I would appreciate a bit of help in that regard.
Thanks in advance.
PS: Here is a Web Player Demo of my current Project: My Web Demo
How to play/test: Type in something as a name. Press Advanced. Then Start hosting a server. Click test and then Start server. Then just select a Team.
If you look for example at the Web Demo I linked to and you shoot with a gun you can see that the Gun kicks upwards and to the sides randomly. At this point i only was able to make the gun kick upwards but not to the sides without it looking weird. I would like to make it similar to the Web Demo i linked to as it looks really fluid. Currently I have it more like.... let's say as seen in this Web Demo : Web Demo (both Web Demos aren't $$anonymous$$e)
Do you understand now what i'm looking for?
Nope. Sorry, but it sounds like what you're saying is "I have this, I want this other thing." That's not a question, and not something I can help you with.
Please tell me what specifically isn't working or what you're having trouble with. Are you wondering how to randomly create a vector between left and right? Are you asking for someone to modify this 'FPS Constructor' for you? (If it's the latter, UnityAnswers is not the place to ask for people to do work for you or add features to 3rd party packages. There is a place on the forums for that, or you can contact the creator of the package.)
i guess the question would be: How can i make a "more realistic" recoil system for my guns that not only kicks upwards but also to the sides as can be seen in the first web demo i linked to? Does this clear things up? Btw. It would be enough for me to get a "push" in the right direction. Coding the system itself i can do but i just don't know how to start. I already tried it but it ended up looking weird and not smooth. Also i'm sorry for my english :)
Answer by sparkzbarca · Mar 16, 2013 at 12:22 AM
i've answered this question before.
http://answers.unity3d.com/questions/384297/aim-at-something-with-delat.html?sort=oldest
the jist is that recoil is directly kicking the gun straight up
But the shot itself actually hits some point inside the radius of a circle whose diameter represents the accuracy of the gun.
so recoil has nothing to do with it. Recoil is very much kick the gun up
Accuracy is what your looking for, and that is measured IRL by basically how small the circle is that x number of rounds fired from x distance perfectly (thats is electronically fired from a gun that has vice grips holding it in place) will hit. Basically guns with less tolerance are more accurate. They will land inside a smaller diameter circle. That circle is what you want
you pick a gun you say at 50 meters all rounds land inside a 5 cm circle and then you go about calculating based on distance the size of teh circle for any distance. Then you go about picking a point at random inside it.
Thank you for your answer sparkzbarca but i either don't understand it or it is not exactly what I'm looking for. If you look at the Web Demo of my Project i just added to the question and you shoot with the A$$anonymous$$ noscoped you can see that there already is innaccuracy which increases when you rapid fire. From what i understood from your answer you are talking about such inaccuracy but i would really like to make a system as can be seen in the FPS Constructur. So what that means is that the Buller on in my case the raycast hits exactly where the iron sight/scope indicates (in my Web Player Demo the animation for that scope is still missing but it will be there when i implement the real model) after the shoot the gun aims at a point higher and a bit to the left/right. If i got this for Ai$$anonymous$$g down sights i will probably also implement something similar for noscoping again similar to the FPS Constructor Demo because i like how fluid the gameplay feels in it.
PS: I now tried it again with this line:
Player.rotation.y += Random.Range(-0.005, 0.005);
...and it doesn't look as bad as last time i tried it so i think i can do it on my own. Thank you for your answer it is very interesting to read.
Player.rotation.y += Random.Range(-0.005, 0.005); this code work for me tanx :D
Your answer
![](https://koobas.hobune.stream/wayback/20220613094455im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to Implement First Shot Accuracy? 2 Answers
Camera Recoil,Please help me. 2 Answers
Using recoil on a Gun? 1 Answer
Weapon random movement 0 Answers
Aiming down sights 4 Answers