|
| 09 Nov 2015 07:26 PM |
Trying to create a ray between 2 points. Don't need to detect parts or anything like that. Just need to make the ray part and then remove it after half a second.
--fire is being passed a part or union
local function fire(target) local function mkRay(origin, goal) --local ray = Ray.new(origin, goal * 300) local beam = Instance.new("Part", game.Workspace) local distance = (origin-goal).magnitude beam.Size = Vector3.new(0.3, 0.3, distance) beam.CFrame = CFrame.new(origin, goal) * CFrame.new(0, 0, -distance / 2) game.Debris:AddItem(beam, 0.5) end mkRay(model.Origin1.CFrame.p, target.CFrame.p) mkRay(model.Origin2.CFrame.p, target.CFrame.p) end
Much love -GO |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 09 Nov 2015 07:30 PM |
I did, I just didn't post the whole thing.
Much love -GO |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 09 Nov 2015 07:31 PM |
| Oh, well can you be more clear. What's not working? Any errors? etc. because what you have seems fine. (although you might have to change the formfactor to custom) |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2015 07:33 PM |
goal isnt a unit vector
ray = Ray.new(start,direction*distance) ray = Ray.new(start,(end-start)*distance) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 09 Nov 2015 07:34 PM |
| OP's not creating a ray, it's 'commented' out but if he does decide then yeah. (end - start) (without the * distance) |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2015 07:38 PM |
Yeah. Just trying to create a part between 2 points. I don't actually need the functionality of a ray.
The result of this is very weird.
It just kind of lagged the game out, similar to how an infinite loop does, although this is not inside an infinite loop so I'm not sure what happened.
Much love -GO |
|
|
| Report Abuse |
|
|