Plurf
|
  |
| Joined: 11 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2014 07:02 PM |
| Do I have to use some type of equation to do this? |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2014 07:04 PM |
| It's pretty easy. Just add a "spread" feature to it. No, you don't need an equation. |
|
|
| Report Abuse |
|
|
Plurf
|
  |
| Joined: 11 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2014 07:32 PM |
| I added a spread and now I have multiple rays? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Dec 2014 07:34 PM |
You shouldn't have multiple rays if you did it correctly.
something liek..
local spread = 10
local ray = Ray.new( startVector, endVector * Vector3.new(spread * .6) ) |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 27 Dec 2014 07:37 PM |
Yes you do need an equation
This is from a really old script I didn't make: spread = 0.5 local rndm=Vector3.new(math.random(-(spread/10)*mag,(spread/10)*mag),math.random(-(spread/10)*mag,(spread/10)*mag),math.random(-(spread/10)*mag,(spread/10)*mag)) local dir=(mouse.Hit.p+rndm)-startpoint
Notice how the rndm vector (spread) is added to mouse.Hit.p. |
|
|
| Report Abuse |
|
|
Plurf
|
  |
| Joined: 11 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2014 07:41 PM |
When I do that I get an error.
Ray length must be <= 1000.000000 |
|
|
| Report Abuse |
|
|
Plurf
|
  |
| Joined: 11 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2014 07:42 PM |
| The above response was meant for goul |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Dec 2014 07:42 PM |
| Lol that is a lot of math for no reason. Just do something simple like I said.. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 27 Dec 2014 07:44 PM |
What the hell is that? local spread = 10 local spreadVector = Vector3.new(math.random(-spread, spread), math.random(-spread, spread), math.random(-spread, spread))
and then add that on to your endVector |
|
|
| Report Abuse |
|
|
Plurf
|
  |
| Joined: 11 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2014 07:48 PM |
Still getting more than one ray when unequipped.
ray = Ray.new(Tool.Handle.CFrame.p , ((mouse.Hit.p - Tool.Handle.CFrame.p) .unit+ Vector3.new(math.random(-1,1) / 70,math.random(-1,1) / 70,math.random(-1,1) / 70 ))*300) |
|
|
| Report Abuse |
|
|