Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to do a beam that moves in different directions?

Found 1 interesting game and many months ago and found something very interesting, he made a beam that can move randomly : https://gyazo.com/9eafa30aa605f6301e8713bcb7054cfa

At the time I was a little bad at programming, now I want to know how I can make a similar one.

I do not want a script, just instructions or what he did to create this, I believe he used Bezier curves

2 comments

0

Don't go from little experience to coding stuff like this. It's better to work slowly and reach to the top, so you actually understand what this is when you're scripting it.

1

I have to disagree with Groovyll here in general -- working on something you don't fully understand is the first step to understanding it. In any case, it seems like OP isn't very new anymore. I would guess he generates four control points for a 5th(?)-degree bezier curve. One at each end, and two in the middle offset by some random amount. Interpolate from t=0 to t=1 and voila.

1 answer

✓ Accepted answer

My personal guess:

I would say he generated 1-2 random points within the radius of the player, then used Bezier curves to fill in the blanks.

Worth noting; doing Bezier curves is actually really easy. Waffle taught me this:

local p1 = pos
local p2 = pos
local p3 = pos

for i = 1, 20 do
	local part = Instance.new("Part")
	part.Size = Vector3.new(1,1,1)
	part.Shape = "Ball"
	part.Anchored = true
	part.CanCollide = false

	local x = i/20
	part.CFrame = CFrame.new(p1:lerp(p3, x):lerp(p3:lerp(p2, x), x))

	part.Parent = workspace

	wait(.2)
end

In case I didn't do that right here's what Waffle said.

3 comments

0

Thank you for helping me, now I have more notion about what to do, this will help me a lot in the future.

0

https://gyazo.com/38ab5be63d90db7132d6f641bc746837 , its not perfect but looks cool ^-^

0

<3

This discussion is preserved as it was. New answers, comments, and votes are closed.