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: Laser Raycaster

Previous Thread :: Next Thread 
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 11:37 AM
Alright since my last post was worded terribly I am trying to make a laser pointer using ray casting, so when it is turned on it creates a ray that extends til it finds a part then it creates a part that extends to where it made contact, I am very new to raycasting so I am looking for some help! I don't want it to use mouse.hit like raycasting guns but just straight from the brick, thanks a ton in advance!
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 12:00 PM
b
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 01:20 PM
b
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
08 May 2016 01:20 PM
I want to know this also. Just check and see if the ray touches a part?


Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 01:24 PM
Yeah I know that part I just wanna know how to calculate the magnitude and stuff and create a brick that extends from the brick to the part the ray touched.
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 03:39 PM
b
Report Abuse
wonderful72pike is online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
08 May 2016 03:40 PM
Here's the wiki page you're looking for:

http://wiki.roblox.com/index.php?title=Making_a_ray-casting_laser_gun
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 03:51 PM
Yes but that uses mouse.Hit, how would I make the ray come straight from the brick?
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
08 May 2016 03:53 PM
Cast a ray from the brick to the player as soon as it hits the brick.


~~~Da siggy is OP~~~
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
08 May 2016 03:54 PM
Oh straight from... wouldn't you just change the values you cast the ray from being the head and the brick?


~~~Da siggy is OP~~~
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 03:58 PM
I guess I didn't word it right I want to have a script in a brick, not a tool. I am trying to figure out how I would make like a laser that comes from a brick and extends until it touches a brick, thanks.
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 04:14 PM
I have this script i've been tinkering with but I need to make it so the ray only comes out of the front of the brick and doesnt change when the brick is moved, thanks

while wait() do
local ray = Ray.new(script.Parent.CFrame.p, (script.Parent.CFrame.p).unit * 512)
local part, position = workspace:FindPartOnRay(ray)
local beam = script.Parent.Beam
beam.BrickColor = BrickColor.new("Bright red")
beam.Material = "Neon"
beam.Transparency = 0.25
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
local distance = (script.Parent.CFrame.p - position).magnitude
beam.Size = Vector3.new(0.3, 0.3, distance)
beam.CFrame = CFrame.new(script.Parent.CFrame.p,position) * CFrame.new(0, 0, -distance / 2)
end
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 04:26 PM
b
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 05:42 PM
b
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
08 May 2016 05:43 PM
raycast has a start and end point
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
08 May 2016 05:48 PM
your point
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
08 May 2016 05:52 PM
It takes Vector3 Values.
Vector3 values are given by a part's position
or a location on map.
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