I have been trying to make a trail from a part but it would never work since it would just spawn the parts somewhere else, but some would spawn.
local model2 = Instance.new("Folder")
model2.Name = "Parts Visualize"
model2.Parent = workspace
local Debris = game:GetService("Debris")
local mathHuge = math.huge
local function CFramePointRightSide(Pos1 ,Pos2)
local directionToFace = (Pos1 - Pos2).unit
local worldUp = Vector3.new(0,1,0)
local zAxisFace = directionToFace:Cross(worldUp)
local yAxisFace = directionToFace:Cross(zAxisFace)
return CFrame.fromMatrix(Pos1, directionToFace, yAxisFace, -zAxisFace)
end
model = Instance.new("Folder")
model.Name = "Part Points"
model.Parent = workspace
local mathHuge = math.huge
local function makePoints(oldPos, newPos)
local Connect = Instance.new("Part", model)
Connect.Anchored = true
Connect.CanCollide = false
Connect.Name = ("Connect")
Connect.Shape = Enum.PartType.Cylinder
Connect.Material = Enum.Material.Neon
Connect.Color = Color3.fromRGB(218, 0, 5)
local Distance = (oldPos - newPos).Magnitude
Connect.Size = Vector3.new(Distance,0.3,0.3) -- count_Parts[i + 1] count_Parts[i + 1])
Connect.CFrame = CFramePointRightSide((oldPos + newPos)/2 , newPos) -- * CFrame.new(0,0,-Distance/2)
end
local startPart = script.Parent.Position
local endPart = workspace:WaitForChild("Part Pos2")
local part_Lock = Instance.new("Part")
part_Lock.CanCollide = false
part_Lock.Size = Vector3.new(4,4,4)
part_Lock.Transparency = 0.75
part_Lock.Material = Enum.Material.Neon
part_Lock.Color = Color3.fromRGB(188, 0, 18)
part_Lock.Parent = model2
part_Lock.Position = startPart
part_Lock.Massless = true
part_Lock.Name = ("part Beam")
local propulsion = Instance.new("RocketPropulsion")
propulsion.Parent = part_Lock
propulsion.MaxTorque = Vector3.new(mathHuge,mathHuge,mathHuge)
propulsion.CartoonFactor = 100
propulsion.MaxThrust = 77500
propulsion.MaxSpeed = 30
propulsion.ThrustD = 100
propulsion.ThrustP = 9750
propulsion.TurnD = 275
propulsion.TurnP = 2000
propulsion.Target = endPart
propulsion.TargetOffset = Vector3.new(0,0,0)
propulsion.TargetRadius = 10
propulsion:Fire()
propulsion.ReachedTarget:Connect(function()
print("Reached")
Debris:AddItem(propulsion, 0.01)
Debris:AddItem(model, 30)
Debris:AddItem(part_Lock, 0.01)
end)
part_Lock:GetPropertyChangedSignal("Position"):Connect(function()
new_Position = part_Lock.Position
--if new_Position.X ~= old_Position.X or new_Position.Y ~= old_Position.Y then
--print(new_Position - old_Position)
--print(new_Position)
--Pos_New = new_Position
--Pos_Old = old_Position
--end
end)
while wait(0.1) do
part_Lock.Position = part_Lock.Position + Vector3.new(math.random(-4, 4), math.random(-3,3), math.random(0,0))
old_Position = part_Lock.Position
makePoints(old_Position, new_Position)
--CreatePoints(startPart, part_Lock.Position, 13, model, old_Position, new_Position)
end
This is the video to see that it sometimes puts parts: