|
Is there a way to increase the width of the ray?
I have a projectile that's 3x3x3 and since the ray is infinitively small, if the projectile scrapes a player, the damage wouldn't register. |
|
indeimausJoin Date: 2014-09-01 Post Count: 4285 |
use projectiles instead of raycasting at that point |
|
x_oJoin Date: 2015-06-04 Post Count: 4378 |
nop
you could try doing multiple raycasts
"is you dermon?" ~ morashsPeasant |
|
|
Technically, rays don't have length either :P
|
|
|
^
Ik they don't, but like imaginary width. |
|
|
|
Well you can't do this, but you can raycast multiple times.
|
|
|
Damn. So have maybe 9 raycasts to cover the size? |
|
|
You should just be able to do four. Cast along the edges.
~ Shakespeare's Soggy Left Nut |
|
|
I'll need one more for the middle though. |
|
|
True.
~ Shakespeare's Soggy Left Nut |
|
|
How do you position the rays so it covers the sides? |
|
|
Act you're making a ray from the center, but offset it half the height and half the width, making some negative and some positive to get all four corners. |
|
|
You could create a hitbox and then then use a raycast to see if there's nothing in the way. |
|
|
What do you mean 'scrapes a player' ? |
|
crouton04Join Date: 2010-07-07 Post Count: 6557 |
Why raycasting for this? |
|
|
@CrescentJade, because a CFramed BasePart doesn't fire the .Touched event. |
|
|
^^
Actually I'm rendering projectiles locally so less lag.
And anyways, I finished scripting my raycast for this yesterday. I have 5 rays to check for collision now. 1 in the center, and 4 in the corners. |
|