|
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!
(comments are locked)
|
|
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?
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)
|

P.S. How do I insert my script so it looks cool in my posts?
Select the code and hit the code button.