Jellal
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 15 |
|
|
| 03 Jul 2014 06:05 PM |
How 2 occlude more than 1 thing from raycast pls
the 2nd argument is what the ray ignores, i tried making that a table, but surprisingly dat doesnt work. I want to ignore both the bulletz and the character, but when da bullets r parented to da char they go invisible when u zoom in cuz its local to u. i need to occlude both the player character and da bullet without making the bullet local to u (in workspace) it sux cuz your bullets keep hitting your last bullet when they arent local to you. help pls i luv u much
tl;dr version: how 2 make last argument two things instead of one
code below pls ------------------------------------------------ local hit, position = game.Workspace:FindPartOnRay(ray, Player.Character) |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 06:39 PM |
| Game.Workspace:FindPartOnRayWithIgnoreList(ray, ignore table, b00l terraincells) |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 06:40 PM |
local ignore = {'game.Workspace.Thing', game.Players.LocalPlayer.Character, etc}; game.Workspace:FindPartOnRayWithIgnoreList(ray, ignore, false);
|
|
|
| Report Abuse |
|
|
Jellal
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 15 |
|
|
| 03 Jul 2014 06:48 PM |
| Thanks, what does the third 'false' mean? The wiki on raycasting is pretty bad. I think you have the wrong language with ";" btw XD too used to C/Java? :3 |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 06:54 PM |
Nah. :3
Semi-Colons are used in Lua also. :p |
|
|
| Report Abuse |
|
|
Jellal
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 15 |
|
|
| 03 Jul 2014 06:59 PM |
Problem is the gun fires fast and it doesn't ignore all the previous bullets fired though. Is there a way to occlude things actually named Bullet?
If not I'll just remove the bullet immediately if it hits something that can be hurt. I guess it doesn't matter too much. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:31 PM |
| ignore = {'game.Workspace.Whatever', 'game.Workspace:FindFirstChild("Bullet")'}; |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:40 PM |
*Put all bullets in a model.
*Add that model to the ignore list. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 08:08 PM |
| The last "false" is whether or not it will detect terrain |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 08:26 PM |
The last "false" is whether or not it will detect terrain
Actually, I am quite sure if if it assumes the terrain to be JUST cubes, rather than cube/wedge hybrid. |
|
|
| Report Abuse |
|
|