|
| 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
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 28 Apr 2014 11:41 AM |
| Can't you use the original direction? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
| |
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 28 Apr 2014 12:36 PM |
Are you serious... ray.Direction -_- |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 28 Apr 2014 12:54 PM |
| Use the position and Ray.Direction! |
|
|
| Report Abuse |
|
|
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 |
|
|