|
| 21 Dec 2014 11:54 AM |
I am making an anti-aerial cannon that takes down any (or most) airborne vehicle, but I have a couple of problems.
What would be the best way to determine if a given model is airborne? If I based it off of Y position, then my cannon couldn't operate atop mountains or very high places. I was thinking about raycasting downwards from the given model, but I am not too fond of that idea.
Secondly, is there a good way to differentiate cars from planes?
And would it be a good idea to check if something is a vehicle by recursively checking for a seat? |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 21 Dec 2014 11:58 AM |
Yes you should use raycast, that's probably the best solution.
Helpful links:
http://wiki.roblox.com/index.php?title=How_to_Make_a_Raycasting_Lasergun http://wiki.roblox.com/index.php/Raycasting http://wiki.roblox.com/index.php/FindPartOnRay |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2014 11:59 AM |
| First you should raycast from the gun to the plane, than raycast from the plane down to see if its airborn |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2014 12:41 PM |
| I know how to raycast, I was just wondering if there was anything that would be easier. |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2014 12:42 PM |
| Not easier, I mean more effective (unless raycasting is the best option). |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2014 12:48 PM |
| What you do is loop though all of the vheicals, than you send a raycast down on each one to see if it's in the air. Then you send a ray from the gun to the plane to see if anything is in the way and get the range, shoot closest one |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2014 12:51 PM |
???
just put a value inside of air vehicles.. a tank flying through the air doesn't make it's armor automatically more vulnerable to anti-air cannons |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2014 12:54 PM |
| It's an anti aircraft autosentry. |
|
|
| Report Abuse |
|
|