|
| 17 Jul 2011 10:45 AM |
| Is there a way to find a brick at a certain CFrame? I want to make a missile homing system and want to find a brick that the plane is pointing at using lookVector. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 10:47 AM |
| Get the front part of the plane and its lookVector then see what's in front of it? |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 10:57 AM |
| Exactly, how to do that :P |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Jul 2011 11:03 AM |
| Name the part that's in the front of the plane Front or something and then find that part and get it's lookVector, multiple it by the number of studs you want to check. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 11:05 AM |
| That part I get. And then how to actually find the part that is at that position? |
|
|
| Report Abuse |
|
|
sncplay42
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 11891 |
|
|
| 17 Jul 2011 11:07 AM |
That sounds like you're looking for FindPartOnRay.
http://wiki.roblox.com/index.php/FindPartOnRay_%28Method%29 |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 11:08 AM |
| I was thinking of that. But there is a way through lookVector. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 11:13 AM |
Hmmm. Let's see
pos = main.CFrame + (main.CFrame.lookVector * 800)
That'll be the CFrame value. Now
region1 = CFrame.new(pos.X - 10, pos.Y - 10, pos.Z - 10) region2 = CFrame.new(pos.X + 10, pos.Y + 10, pos.Z + 10) region3 = Region3.new(region1.p, region2.p) x = game.Workspace:FindPartsInRegion3(region3) for i = 1,#x do if x:IsDescendentOf("RedPlane") then -blah end end
|
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 11:15 AM |
| Well I can't help right now I'm busy. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Jul 2011 11:19 AM |
| Guess it isn't such a simple question. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 11:26 AM |
Is this an epic hard question? Title fix then. |
|
|
| Report Abuse |
|
|
| |
|
| |
|