What is the issue? Include screenshots / videos if possible!
Here is the issue, I made the bezier curve work but it doesn’t have a nice curve, even the curve size doesn’t go right.Here is a gif https://gyazo.com/fdba439b99feff1a93038e3f8cbae89e
I think the problem is because the part isn’t rotating, but i kept trying to make it rotate but it won’t work right.Also, it is a server script
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have looked at youtube videos and many forums, and some free model bezier curves but I don’t understand why I have a problem here.I have tried to adjust the code many times but it won’t go smooth.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local function QuadraticBezier(t,p0,p1,p2)
local Part0 = workspace.Part0;
local Part1 = workspace.Part1;
local Part2 = workspace.Part2;
local START = script.Parent;
local attach1 = workspace.Part0.Attachment
local attach2 = script.Parent.Attachment
for t = 0,1,0.01 do
local TargetPosition = QuadraticBezier(t , Part0.Position, Part1.Position, Part2.Position);
local ExitPosition = QuadraticBezier(t , Part2.Position, Part1.Position, Part0.Position);
START.Position = START.Position:Lerp(TargetPosition, t)
START.Orientation = ExitPosition
attach1.Orientation = TargetPosition
local beam = START.Beam
beam.CurveSize0 = (Part0.Position - Part1.Position).magnitude/2
beam.CurveSize1 = -(Part0.Position - Part1.Position).magnitude/2
I’m not sure about the issue with the Beam object you’re currently using, but I’m certain that in the example you’ve provided in the first gif, Trailing is being used instead of Beaming.
If using the Beam object is not necessarily for you and you just want to achieve the same as in the example, you could easily manage to create it using an individual Trail object and 2 attachments attached to the moving part, also making the whole process much smoother and better-looking.
Beams are not meant to be used this way…
You could possibly obtain the same effect with massive constant math calculations, which will also slow down your whole game. Trail would be capable of having the exact same effect with its many properties.
By rotate I mean the way it curves from sideways, so it has a beam curve with a peak point from going sideways then going down, but in egomoose his is only from a straight line and so he can just change the position of the attachment and change the curve size depending on the distance.
It doesn’t matter if it’s going sideways. Just because the curve curves in a different direction doesn’t mean you can’t make it curve sideways. I actually created a bezier curve lab awhile ago when I was first learning about them, so maybe it might help you. I just published it so you can use it.