|
| 23 Aug 2014 07:57 PM |
I'm making a gun, and I want to wait() so long to interprate a the time it takes a bullet to travel.
Lets say one foot is 2 feet. If the feetpersecond is 2000, what equation would I put to wait() the correct amount of time based on the distance(dis) |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 07:58 PM |
What is the distance...?
If you look closely, I don't give a crap. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 07:59 PM |
| Distance is dis, which could be any number, but for example its 500 |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:01 PM |
| Wouldn't it be easier and better to just like. Get the time it was fired and then get the time it hit and get the time or something based on that. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:02 PM |
^I support that.
If you look closely, I don't give a crap. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:02 PM |
| I'm using two raycasts one to get the distance and the second to hit the player. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:03 PM |
| Why do you even want to do this. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:04 PM |
To simulate the time it takes the bullet to travel..
|
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:05 PM |
| What are you even going to do with the information of knowing how long it took to travel. You can just get the time it was fired and the time it hit to get dat info by figuring out what the gap in-between is. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:08 PM |
| "Lets say one foot is 2 feet." wtf |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:09 PM |
...
You don't know what I'm doing right?
I send the ray, the distance is gotten by the first ray.
Than I wait() the amount of time based on the distance and the feetpersecond. Than I send the second ray from and two the same points as the first ray and if theres still a part there than I damage it. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:09 PM |
| Lets say one foot is 2 studs, sorry. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:10 PM |
| Why not stop usin rays and just fire an actual projectile. Derp |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:12 PM |
Because they are unreliable, laggy, and garbage. Rays are far more superior. Now if you could please just figure out my problem instead of criticizing me that would be great. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:13 PM |
"Rays are far more superior." ooops I mean far superior. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:17 PM |
They aren't 'laggy'. They add in as many parts as a ray would. Also, if you know how to do them right they aren't 'unreliable'. And a projectile can look much nicer than a ray. Would you prefer: a tiny ball shot from a gun that moves very quickly and looks realistic OR a freaking laser coming from your gun that makes it very easy for someone to see where you are. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:18 PM |
let me explain again..
I have the distance between two spots, lets say thats 500. Now I have the speed in which the bullet is traveling, which is 6000 studs per second
How do I figure out how long it will take to travel the 500 studs? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:19 PM |
| It will take a 12th of a second. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:20 PM |
Cause 500 = 1/12 of 6000
such simple maths |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:20 PM |
speed=distance/time
So would I do distance*speed or distance/speed or speed/distance or something? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:21 PM |
--create ray.
local hit = Instance.new("BoolValue", bullet); hit.Name = "impact"; local value = Instance.new("IntValue", bullet)-- create the bullet var value.Name = "distanceTime"; coroutine.wrap(function() while not (hit.Value == true) do value.Value = value.Value + 1; wait(1); end end)() if (RayImpactVariableHere) then hit.Value = true; end |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:21 PM |
| It was an example I'm doing algebra distance could be 193 or 806 and feetpersecond could be 5000 or 7000 or 2032. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:22 PM |
| Ok nvm. you might want to make the speed of the bullet, then use the wait function and divide it's time by something in the while loop. idk |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:22 PM |
I already have the rays I'm trying to figure out how long to wait() to simulate the time it takes a bullet to move that distance..
You are way over complicating things with your questions. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2014 08:23 PM |
| The bullet is nothing! There is no bullet! THe speed is just a number and the distance is just a number. |
|
|
| Report Abuse |
|
|