generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Simple question

Previous Thread :: Next Thread 
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
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
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
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
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 10:57 AM
Exactly, how to do that :P
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 11:02 AM
Help
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
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
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
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 is not online. 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
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 11:08 AM
I was thinking of that. But there is a way through lookVector.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
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
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
17 Jul 2011 11:15 AM
Well I can't help right now I'm busy.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 11:16 AM
Well then, Robert?
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 11:19 AM
Guess it isn't such a simple question.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 11:26 AM
Is this an epic hard question?
Title fix then.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 11:34 AM
Help
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
17 Jul 2011 01:46 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image