Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ExTheSea · Mar 15, 2013 at 03:19 PM · fpsgunrecoilaccuracy

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.

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Julien-Lynge · Mar 15, 2013 at 05:50 PM 2
Share

What, exactly, is your question?

avatar image ExTheSea · Mar 15, 2013 at 06:16 PM 0
Share

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?

avatar image Julien-Lynge · Mar 15, 2013 at 07:46 PM 1
Share

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.)

avatar image Fattie · Mar 15, 2013 at 10:32 PM 0
Share

it's vague question night! :)

avatar image ExTheSea · Mar 15, 2013 at 11:47 PM 0
Share

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 :)

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ExTheSea · Mar 16, 2013 at 11:50 AM 0
Share

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.

avatar image djary · Dec 08, 2013 at 01:06 PM 0
Share

Player.rotation.y += Random.Range(-0.005, 0.005); this code work for me tanx :D

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges