x


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!

more ▼

asked Jun 20 '11 at 05:42 PM

cgartist4jc gravatar image

cgartist4jc
27 11 12 14

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

Jun 23 '11 at 09:40 PM cgartist4jc

Select the code and hit the code button.

Jun 23 '11 at 09:52 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered Jun 20 '11 at 05:45 PM

almo gravatar image

almo
1.7k 2 6 18

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?

Jun 20 '11 at 05:47 PM cgartist4jc

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

Jun 20 '11 at 05:57 PM almo

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

Jun 20 '11 at 06:12 PM Eric5h5

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

Jun 20 '11 at 06:56 PM almo

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

Jun 20 '11 at 07:10 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1175
x446
x329
x24
x1

asked: Jun 20 '11 at 05:42 PM

Seen: 1229 times

Last Updated: Jun 23 '11 at 09:52 PM