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: Bullet penetration (raycasting) need help!

Previous Thread :: Next Thread 
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
28 Apr 2014 11:39 AM
local ray = Ray.new(tool.Handle.Position, (mouse.Hit.p - tool.Handle.Position).unit*999)
local hit, pos = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignore)

if hit.Material == Enum.Material.Wood then
--PENETRATE!
local penetrationRay = Ray.new()


I know I can set the second ray's start position to the first ray's hit position, but what direction do I set it to?
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Apr 2014 11:41 AM
Can't you use the original direction?
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
28 Apr 2014 11:42 AM
if I set the penetrating ray to use mouse.Hit.p again It wont go towards like a bullet would
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
28 Apr 2014 11:58 AM
bump
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
28 Apr 2014 12:17 PM
bump D:
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
28 Apr 2014 12:33 PM
omg bump
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
28 Apr 2014 12:36 PM
Are you serious...
ray.Direction -_-
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Apr 2014 12:36 PM
Draw two rays, one that will hit the wood, other passes through everything.

When the first ray hits wood, use the second ray's hit position.
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
28 Apr 2014 12:40 PM
What If I told you there might be 6+ windows/wood objects in a row in the map, and the bullet should penetrate all of them? I cant predict how many objects might be in the bullet's path
Report Abuse
Voidition is not online. Voidition
Joined: 14 Jul 2012
Total Posts: 1849
28 Apr 2014 12:51 PM
lol 'penetrate' lol feeling so immature rite nao lol lol
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
28 Apr 2014 12:54 PM
Use the position and Ray.Direction!
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
28 Apr 2014 02:03 PM
Add every single penetrable brick to the ignore list. That'd be the fastest way.

The only problem is reducing the damage of the bullet if a penetration is detected
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