Wsg, Partner!
I need help with my Bezier’s Curve Instance’s / balls / part / object or whatever you call it. The Instance’s sometimes spawn in the skies or really far. I tried my best to solve the problem (Changing the value, Anchor & Unanchor either inside the script & the property of the Instance itself.) but the problem keep staying in there… so, I kinda need someone’s help & their knowledges.
IF THE VIDEO TAKES REALLY LONG TO LOAD, OPEN UP YOUR DISCORD, COPY THE LINK AND MAKE YOUR OWN GROUP CHAT (invite ppl, then kick them really quick or dm random bots) AND PASTE IT THERE
Here’s a video of it: (1st video, when I copy the og one & pasted into the other game & fixing it up a bit)
https://medal.tv/games/roblox-studio/clips/pinEsJDmsnSvo/d1337NRnJ17U?invite=cr-MSwwWDcsMTE2OTIwODEs
It should be looks like this: (2nd video, the og one)
https://medal.tv/games/roblox-studio/clips/pacEYj1ILBKAb/d1337fp6i4Zt?invite=cr-MSxCZkksMTE2OTIwODEs
(This is a diff game that I tested, when I was learning about Bezier Curve, but WHEN I copy & paste them to the other game / experiences. It have a diff result… It’s kinda slightly worst than the vid that I showed you on the FIRST video)
This is my Bezier Curve’s scripts. (OG AND THE NEW ONE, tried my best to keep it simple as possible)
-- THIS IS THE OLD VERISON / OG VERISON
local RPS = game:GetService("ReplicatedStorage")
local RE = RPS.Pikaballremote
function lerp(a, b, c)
return a + (b - a) * c
end
function quad(t, p0, p1, p2)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1, l2, t)
return quad
end
local Char = plr.Character or plr.CharacterAdded:Wait()
local HRT = Char:WaitForChild("HumanoidRootPart")
local start = HRT.Position + Vector3.new(math.random(1, 7), 0, math.random(2, 7))
local finish = mousehit.Position
local Mid = (start - finish) + Vector3.new(math.random(0, 5), math.random(15, 30), math.random(0, 5))
local PikaBalls = RPS.PikaBall:Clone()
PikaBalls.Parent = workspace
for i = 0, 1, .1 do
PikaBalls.CFrame = CFrame.new(quad(i, start, Mid, finish))
task.wait(0.006)
end
end)
-------- THIS IS THE NEW VERISON ---------
function lerp(a, b, c)
return a + (b - a) * c
end
function quad(t, p0, p1, p2)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1, l2, t)
return quad
end
local Char = plr.Character or plr.CharacterAdded:Wait()
local HRT = Char:WaitForChild("HumanoidRootPart")
local start = HRT.Position + Vector3.new(math.random(0, 3), 0, math.random(1, 3))
local finish = mousehit.Position
local Mid = (start - finish)/2
local NewMid = Mid + Vector3.new(0, 30, 0)
for i = 0, 1, .1 do
if PikaBalls:FindFirstChild("Touched") then return end
local yes = quad(i, start, NewMid, finish)
PikaBalls.Position = yes
task.wait(0.002)
PikaBalls.Anchored = false -- To be able to detect anything on touch event & clone an explosion (you know, when you watch the vid)
end
Thanks for reading, Partner.
I’ll be appreciated, if someone knows something about it.