Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 cgartist4jc · Jun 20, 2011 at 05:42 PM · fpsgunshootrealistic

Meters Per Second, or Feet Per Second?

Hey Gang!

I am making an FPS game. I wanted my guns bullets to have an accurate Feet/second. But then i was reading scripting tutorials and it was saying something about Unity does meters not feet. Should I make "how fast the bullet goes" varible in Feet/sec or Meters/sec?

New Related Question!!!

I made a script very similar to the FPS Tutorial. To get realistic bullet results, I did this:

var MPS : int = 35;

var BB : Rigidbody;

var automaticWeapon : boolean = false;

var semiAutoWeapon : boolean = true;

var lastShot;

var shotInterval : float = .1f;

var deleteBulletTime = 4.5;

function Update () {

if(semiAutoWeapon == true){

if(Input.GetButtonDown('Fire1')){

var instantiatedBB : Rigidbody = Instantiate(BB, transform.position, transform.rotation);

instantiatedBB.velocity = transform.TransformDirection(Vector3( 0, 0, **MPS Time.deltaTime* )); Physics.IgnoreCollision( instantiatedBB. collider, transform.root.collider );

I added the Time.deltaTime thing the MPS variable so that the bullets would move at Meters per second and not Frames per second. But then, when I shoot the bullets, they only go, like a meter in front of the person, and fall to the ground. what do I do? Thanks for the help!

Comment
Add comment · Show 2
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 cgartist4jc · Jun 23, 2011 at 09:40 PM 0
Share

P.S. How do I insert my script so it looks cool in my posts?

avatar image Eric5h5 · Jun 23, 2011 at 09:52 PM 0
Share

Select the code and hit the code button.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by almo · Jun 20, 2011 at 05:45 PM

I recommend meters/sec. Will save you a lot of hassle. Scale everything in your scenes with meters.

Comment
Add comment · Show 5 · 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 cgartist4jc · Jun 20, 2011 at 05:47 PM 0
Share

Thanks! Ok thats what I was thinking! About Scaling: I use blender, and it has a automatic rig that is human size and I always scale my objects to that and scale unity obects to 1. Is that the same as scaling it to meters?

avatar image almo · Jun 20, 2011 at 05:57 PM 1
Share
  1. meters = 5 feet. So if you do a person in blender and he comes into Unity, and Unity says his height is around 1.4, then you're on the right track. You don't want to have to scale things once they come into Unity, either. So the Scale X, Y, and Z parameters in Unity should all be 1.

BTW: the official way to say "thanks" here at Unity Answers is to click the checkmark by my answer. :)

avatar image Eric5h5 · Jun 20, 2011 at 06:12 PM 2
Share

@almo: 5 feet is 1.5 meters. Also, that's kinda short. 6 feet (1.8 meters) would be more standard.

avatar image almo · Jun 20, 2011 at 06:56 PM 0
Share

One of the thumbs on Eric's comment is from me. :)

avatar image Eric5h5 · Jun 20, 2011 at 07:10 PM 3
Share

If you're making a FPS game with hobbits, use 1 meter. ;)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Aiming Gun at Cursor 2 Answers

how to make bullets apply damage 1 Answer

Problems with a shooting script 1 Answer

How do i make a fps where the gun always shoots realisticly 3 Answers

FPS PISTOL 1 Answer


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