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 » Scripters
Home Search
 

Re: RayCasting

Previous Thread :: Next Thread 
commag is not online. commag
Joined: 28 Sep 2013
Total Posts: 18
31 Mar 2017 06:08 PM
Now, before you spam me with the wiki page, I read it and it was not helpful at all. I just want an explanation of how you use it, the properties, etc. It would be really Appreciated. Thanks in advance

~Commag
Report Abuse
SnowyKirby is online. SnowyKirby
Joined: 15 Jan 2013
Total Posts: 68009
31 Mar 2017 06:13 PM
wiki.roblox.com/index.php?title=Raycasting_Basics


Report Abuse
commag is not online. commag
Joined: 28 Sep 2013
Total Posts: 18
31 Mar 2017 06:18 PM
Read the first part.
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
31 Mar 2017 06:37 PM
wiki.roblox.com/index.php?title=Making_a_ray-casting_laser_gun


capitalist atheist
Report Abuse
commag is not online. commag
Joined: 28 Sep 2013
Total Posts: 18
01 Apr 2017 06:40 AM
Bump
Report Abuse
seagrams is not online. seagrams
Joined: 15 Mar 2007
Total Posts: 4
01 Apr 2017 07:25 AM
I'm gonna be honest here, if you can't understand how to read the wiki format, then I would sudgest starting with the basics. you can't just run if you don't know how to walk
Report Abuse
Thedagz is not online. Thedagz
Joined: 10 Mar 2012
Total Posts: 798
01 Apr 2017 08:51 AM
I know how you feel, I also didn't understand the raycasting wiki either and had to get someone to explain it to me.

So raycasting is just creating a ray "Simple right?" It is similar to a vector

Raycasting has 2 things in order for it to be created.. Origin and Direction

Direction is similar to lookvector but its not a unit vector

Origin is just where it starts at...

To create a ray this is how you do it

local Ray ###a#.###############################################-- So this ray is made at point 0,0,0 and is shooting 10 studs upward *Because its in the Y axis*

However just having a Ray doesn't do much so we use a function called FindRayOnPartWithIgnoreList()

local Part,Position = game.Workspace:FindPartOnRayWithIgnoreList(Ray,{})

The findpartonraywithignorelist is a function returns a part and position"And some other stuff" using the ray

So when you cast a ray and it intersects anything it will return that part

For example

local Part = Instance.new("Part")
Part.Position = Vector3.new(0,5,0)
Part.Parent = game.Workspace

local Coll############a#.###############################################Starts at 0,0,0 and goes up 50 studs

local Part,Position = game.Workspace:FindPartOnRayWithIgnoreList(CollisionRay,{BasePlate}) -- For the ignore table, its just parts that the ray collision ignores

print(Part,Position) -- Returns Part and the position of 0,5,0

Now that the basics are done.. What can this be used for?

My friend created an A##w##re it cast rays in front of the AI and if there was a player the AI would run away

The TouchEnded event is very glitchy so you could actually raycast downward from your chararacter to see if Part == nil

You can create a projectile using CFrame movement and use Raycast for the collision..

if you have any questions you can ## ## "You gotta follow me to ## ## though"
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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