How does I build/form a curve?
Page 1 of 1 • Share •
How does I build/form a curve?
Hi! I wonder if anybody could tell me how to build a curve? I realy need to know how cause i wanna build something like a loop for cars.
kirre1997- Posts: 5
Join date: 2008-10-13
Re: How does I build/form a curve?
You have to make a script like (lateral curve):
_G["Circle"] = function(Center,Radius,Rails,Startn,Stopn)
local Start = Startn/180*math.pi
local Stop = Stopn/180*math.pi
if(Rails<1)then return end
local Dif = Stop-Start
local Inter = Dif/Rails
for i = 0,Rails do
local P = Instance.new("Part")
local Place0 = Vector3.new(math.sin(Start+(i*Inter))*Radius,0,math.cos(Start+(i*Inter))*Radius)+Center
local Place1 = Vector3.new(math.sin(Start+((i+1)*Inter))*Radius,0,math.cos(Start+((i+1)*Inter))*Radius)+Center
P.Size = Vector3.new(1,2.4,(Place0 - Place1).magnitude)
P.CFrame = CFrame.new((Place0 + Place1)/2,Place0)
P.Parent = game.Workspace
P.Name = "CurvedRail"
P.Color = Color3.new(0.639216, 0.635294, 0.643137)
P.Anchored = true
end
end
Then you can make a call to function Circle with the parameters (Well named in my opinion)
_G["Circle"] = function(Center,Radius,Rails,Startn,Stopn)
local Start = Startn/180*math.pi
local Stop = Stopn/180*math.pi
if(Rails<1)then return end
local Dif = Stop-Start
local Inter = Dif/Rails
for i = 0,Rails do
local P = Instance.new("Part")
local Place0 = Vector3.new(math.sin(Start+(i*Inter))*Radius,0,math.cos(Start+(i*Inter))*Radius)+Center
local Place1 = Vector3.new(math.sin(Start+((i+1)*Inter))*Radius,0,math.cos(Start+((i+1)*Inter))*Radius)+Center
P.Size = Vector3.new(1,2.4,(Place0 - Place1).magnitude)
P.CFrame = CFrame.new((Place0 + Place1)/2,Place0)
P.Parent = game.Workspace
P.Name = "CurvedRail"
P.Color = Color3.new(0.639216, 0.635294, 0.643137)
P.Anchored = true
end
end
Then you can make a call to function Circle with the parameters (Well named in my opinion)

Meelo- Posts: 5
Join date: 2008-10-14
Permissions of this forum:
You cannot reply to topics in this forum





