- Home /
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!
P.S. How do I insert my script so it looks cool in my posts?
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.
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?
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. :)
@almo: 5 feet is 1.5 meters. Also, that's kinda short. 6 feet (1.8 meters) would be more standard.
If you're making a FPS game with hobbits, use 1 meter. ;)
Your answer
Follow this Question
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