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: RayCast CFrame Question

Previous Thread :: Next Thread 
Blockeus is not online. Blockeus
Joined: 21 May 2012
Total Posts: 297
27 May 2013 10:37 AM
rayPart.CFrame = CFrame.new(position, tool.Handle.CFrame.p) * CFrame.new(0, 0, -distance/2)

Lineof Code Found --- http://wiki.roblox.com/index.php/How_to_Make_a_Raycasting_Lasergun



I dont get why it has to be cframe at the tools handle liek that looks confusing.

Especially make the distance negative and dividing it by two
and why i need the position.
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
27 May 2013 11:10 AM
Yes,

If it were easy, a chimp would do it....

Sorry u will just have to look-up every word & method in the Wiki.... Hey this is just like school, isn't it:

rayPart.CFrame = CFrame.new(position, tool.Handle.CFrame.p) * CFrame.new(0, 0, -distance/2)


rayPart is just this program's name for a Part in Space

CFrame is a completely described Postion AND Angle.

Make a New Cframe.

CFrame.new(position, tool.Handle.CFrame.p), with the comma is a Special Method, which always Positions something at 'position', and Looks-at, the second argument (Tool).

* for CFrames is NOT a Multiplication sign. Look-up CFrame in the Wiki.... In this case it moves the CFrame to another position; an offset; or a relative position.

distance/2 is halfway between where the laser Hit, and the Tool, so put the Center Point of our nice, long, Raypart THERE.

GL (Read the WIKI over & over & over.......It's all in there)
Bri




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