Problem with bezier curves

so i tried following the example script but i got this error when using it

local BezierTween = require(ServerScriptService.BezierTween)
local Waypoints = BezierTween.Waypoints
local P0, P1, P2, P3 = workspace.P0, workspace.P1, workspace.P2, workspace.P3

waypoints = Waypoints.new(P0, P1, P2, P3)
local Part = game.Workspace.Moving

local Tween = BezierTween.Create(Part, {
Waypoints = waypoints,
EasingStyle = Enum.EasingStyle.Sine,
EasingDirection = Enum.EasingDirection.In,
Time = 5,
})
Tween:Play()

error:

Workspace.Moving.Script:1: attempt to index nil with ‘BezierTween’ - Server - Script:1

This means that the ‘BezierTween’ is either not accessible at ServerScriptService, or maybe it hasn’t loaded in yet and you are trying to call for it, or the module name itself is not ‘BezierTween’.

A fix if the module is in ServerScriptService and it’s name is ‘BezierTween’, then it’s a good chance the module is trying to be retrieved before it has been loaded.

Also make sure it ain’t a LocalScript since ServerScriptService can’t be accessed from a LocalScript

local BezierModule = game.ServerScriptService:WaitForChild("BezierTween")
local BezierTween = require(BezierModule)

Infinite yield possible on ‘ServerScriptService:WaitForChild(“BezierTween”)’

Stack Begin
12:21:29.874 Script ‘Workspace.Moving.Script’, Line 1 - Studio - Script:1
12:21:29.874 Stack End

its a server script, its not moving still, hmmm idk what the problem is

It’s an infinite yield because the module is not in ServerScriptService, that you are trying to retrieve.

i just saw that now, thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.