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: question

Previous Thread :: Next Thread 
Emess is not online. Emess
Joined: 01 Apr 2010
Total Posts: 13331
29 Sep 2011 09:08 PM
Let's say I have a gun. This awesome looking thing is a gun.
            __
 ______|____
|_   __   ___|]
  |_|  |_|

It's all a mesh. A single part gun. Let's raycast from the gun's position to the mouse's hit location. We then make the laser, but the ray starts at the middle of the gun. How would I use math to make the ray to start at the tip? I'm thinking about [ tool.Handle.Position + Vector3.new(0.5, 0, 0) ] but it doesn't work properly.

thx
Report Abuse
thisissporez is not online. thisissporez
Joined: 04 Sep 2011
Total Posts: 1273
29 Sep 2011 09:09 PM
you dont use a mesh

mk yw
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
29 Sep 2011 09:09 PM
[ Content Deleted ]
Report Abuse
xSIXx is not online. xSIXx
Joined: 06 Aug 2010
Total Posts: 9202
29 Sep 2011 09:12 PM
your really failing at the simple things in the ROD ripoff.
Report Abuse
aboy5643a is not online. aboy5643a
Joined: 20 Nov 2010
Total Posts: 2785
29 Sep 2011 09:14 PM
You certainly wouldn't use X and Z maths to do this... Just use the lookVector of the gun and add half of the length of the gun. Ta-da.

"I like dooly-bops" -- ArceusInator
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
29 Sep 2011 09:18 PM
[ Content Deleted ]
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
29 Sep 2011 09:26 PM
[ Content Deleted ]
Report Abuse
aboy5643a is not online. aboy5643a
Joined: 20 Nov 2010
Total Posts: 2785
29 Sep 2011 09:36 PM
*facedesk*

"I like dooly-bops" -- ArceusInator
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
29 Sep 2011 09:38 PM
workspace:FindPartInRay(Ray.new((gun.CFrame + gun.CFrame.lookVector * (gun.Size.z / 2)).p, Direction), Ignore Descendants)
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
29 Sep 2011 09:43 PM
"tool.Handle.Size.y/2"

err

­<'+1 Post. Ujelly?'>
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
29 Sep 2011 10:05 PM
Here's my gun.

     ====+=====
 _______| |__________---|-___
|___    _____ __________----+
      |_|       |_|

It's bigger then yours. It makes a bigger bang.
It also has a better sight.
Report Abuse
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
29 Sep 2011 10:08 PM
gun.cframe + gun.cframe:pointtoobjectspace(0, 0, gun.size.z/2)

something like that
Report Abuse
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
29 Sep 2011 10:10 PM
sorry i derped

gun.cframe + gun.cframe:pointtoobjectspace(gun.position + Vector3.new(0, 0, gun.size.z/2))
Report Abuse
OKevinO is online. OKevinO
Joined: 05 May 2010
Total Posts: 1036
29 Sep 2011 10:44 PM
um dude you should make a brick in front of the gun that is the bullet spawner

and start something with that, like

bullet = Instance.new("SpecialMesh")
bullet.Parent = script.Parent.THEBULLETSPAWNERSNAME


and keep doing stuff like that, its probably wrong because im new to scripting

but thats all i can think of
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
29 Sep 2011 10:55 PM
bullet.CFrame = gun.CFrame * CFrame.new(0,0,something)
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