of     1   

doneyes
#141288882Wednesday, July 23, 2014 5:35 PM GMT

I want to create a part every 3 studs apart on a raycast that will be anchored in place (so it's not the basic solid line we always see) but I don't know where to start on this. Can someone help me out?
ninja900500
#141292625Wednesday, July 23, 2014 6:15 PM GMT

Are you trying to do step raycasting?
blockoo
#141293133Wednesday, July 23, 2014 6:20 PM GMT

Easily: rayStart = --start point of ray rayEnd = --end or intersection of ray for i = 1, math.floor((rayEnd - rayStart).magnitude), 3 do --Instance the new part here Part.CFrame = (rayEnd - rayStart).unit * i end I haven't tested it but I'm pretty sure it will work.
blockoo
#141294235Wednesday, July 23, 2014 6:33 PM GMT

Oh, wait, here: rayStart = --start point of ray rayEnd = --end or intersection of ray for i = 1, math.floor((rayEnd - rayStart).magnitude), 3 do --Instance the new part here Part.CFrame = CFrame.new((rayEnd - rayStart).unit * i) end And if you want the parts facing the ray's intersection point: rayStart = --start point of ray rayEnd = --end or intersection of ray for i = 1, math.floor((rayEnd - rayStart).magnitude), 3 do --Instance the new part here Part.CFrame = CFrame.new((rayEnd - rayStart).unit * i) * CFrame.Angles(CFrame.new(rayStart, rayEnd):toEulerAnglesXYZ()) end
doneyes
#141295813Wednesday, July 23, 2014 6:50 PM GMT

Thanks I'll start testing this.

    of     1