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: Line of Sight (Raycasting)

Previous Thread :: Next Thread 
BowtieMod is not online. BowtieMod
Joined: 01 Apr 2013
Total Posts: 804
12 Aug 2014 09:42 PM
Is it possible to use ray casting to see if an object is in the line of sight of another object?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
12 Aug 2014 09:43 PM
Yeesss, it'd be a lot of angles to cover though lol.
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
12 Aug 2014 10:06 PM
Goulstem?

It would be one angle to cover.

Yes, just shoot a ray from one object to the other. If ray makes it without hitting a different object, then return true.

Take Speed AI from the Catalog for a demo of the old method of AI, and shooting Rays. Turn the Graphics toggle in Explorer to true.


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
12 Aug 2014 10:13 PM
When he said line of sight I thought he meant like.. a player looking at something, their field of view or something.
Report Abuse
BowtieMod is not online. BowtieMod
Joined: 01 Apr 2013
Total Posts: 804
12 Aug 2014 10:16 PM
Hmm.

How would you go about doing that?
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
12 Aug 2014 10:23 PM
As a model take either the Lazer Gun script or Spaeed AI; both can show u the rays u r shooting (It's best to Draw the rays u r shooting, while developing, so u can seewhat's going on....)

Mod that code from there to do what u want to do:

If u r looking for Player then FindNearest; shoot a Ray at him; Return Hit; if nothing is in the way then take a pot shot at him with your BB gun.


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