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 |
|
|
|
| 31 Mar 2017 06:13 PM |
wiki.roblox.com/index.php?title=Raycasting_Basics
|
|
|
| Report Abuse |
|
|
commag
|
  |
| Joined: 28 Sep 2013 |
| Total Posts: 18 |
|
| |
|
|
| 31 Mar 2017 06:37 PM |
wiki.roblox.com/index.php?title=Making_a_ray-casting_laser_gun
capitalist atheist |
|
|
| Report Abuse |
|
|
commag
|
  |
| Joined: 28 Sep 2013 |
| Total Posts: 18 |
|
| |
|
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
|
  |
| 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 |
|
|