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
 

Splitting Raycasting

Previous Thread :: Next Thread 
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
30 Jul 2014 01:55 PM
How can I split :

local Start = Tool.Handle.CFrame.p
local EndPoint = Mouse.Hit.p
Ray.new(Start,(Start-EndPoint).unit)

Into 3 different rays ; Startting, middle and ending ray segment(S)?

Report Abuse
MomoiroCloverZ is not online. MomoiroCloverZ
Joined: 06 Jan 2013
Total Posts: 825
30 Jul 2014 02:04 PM
local distance = (Start-EndPoint).magnitude
local direction = (Start-EndPoint).unit
local start = Ray.new(Start, distance*direction)
local middle = Ray.new(Start+distance*direction, distance*direction)
local end = Ray.new(Start+distance*direction*2, distance*direction)


MomoiroCloverZ, newbag expert Lua coder.
Report Abuse
MomoiroCloverZ is not online. MomoiroCloverZ
Joined: 06 Jan 2013
Total Posts: 825
30 Jul 2014 02:05 PM
Divide distance by 3
*facepalm* I forgot that.


MomoiroCloverZ, newbag expert Lua coder.
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
30 Jul 2014 05:08 PM
Thanks.
Report Abuse
Brickman2010 is not online. Brickman2010
Joined: 20 Nov 2009
Total Posts: 5547
30 Jul 2014 05:27 PM
end is a bad variable though O_O
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
30 Jul 2014 05:29 PM
XD
Report Abuse
MomoiroCloverZ is not online. MomoiroCloverZ
Joined: 06 Jan 2013
Total Posts: 825
30 Jul 2014 05:47 PM
o rite didnt even think about that


MomoiroCloverZ, newbag expert Lua coder.
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
31 Jul 2014 01:30 PM
Ya it is, but I got the idea so its all good.
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