S1xty
|
  |
| Joined: 25 Oct 2009 |
| Total Posts: 2712 |
|
|
| 10 Nov 2016 08:40 PM |
| So I'm trying to make rays go through objects acting as bullets I want to do the following: Go through all objects in its path, but still recognize that it collided with them. Is there a way to do this or is it impossible? Basically I will be ############ this by doing the following: Get a list of parts the ray went through in order of first to last Find the ########### distance of each part that the ray went through, reduce a value in the script based on the ########### resistance of that parts material, and continue to do this until I know which part stopped the ray. This will be used for a gun to have semi-realistic material ############ |
|
|
| Report Abuse |
|
|
S1xty
|
  |
| Joined: 25 Oct 2009 |
| Total Posts: 2712 |
|
|
| 10 Nov 2016 08:41 PM |
First hashtag:
impl 3 mInt eng
the rest:
pen of trait ing |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2016 08:42 PM |
raycast and have a table of previously hit objects for your ray to ignore after that check the thickness of the object using dot product maybe? then just use the density of the object |
|
|
| Report Abuse |
|
|
S1xty
|
  |
| Joined: 25 Oct 2009 |
| Total Posts: 2712 |
|
|
| 10 Nov 2016 08:45 PM |
| That's along the lines of what I was thinking. What is "dot product" for the thickness issue though? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2016 08:46 PM |
| so i guess you can check the thickness of the object (at its current rotation) based on the direction of the bullet |
|
|
| Report Abuse |
|
|
S1xty
|
  |
| Joined: 25 Oct 2009 |
| Total Posts: 2712 |
|
|
| 10 Nov 2016 08:48 PM |
Ok I think I understand it now
thx |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2016 08:48 PM |
an example ignoring the rotation of the brick:
lets say bullet was going straight forward
into a wall with size 3,2,10 and no rotation
print(math.abs(Vector3.new(3,2,10):Dot(Vector3.new(0,0,-1)))) --remember this is without considering the parts rotation
|
|
|
| Report Abuse |
|
|