You can write your topic however you want, but you need to answer these questions:
So I was creating a roblox infinite map illusion in which the player gets teleported back, the problem is when I teleport the player it always causes it to flicker is there any way I can fix this or make a illusion like this but better?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local chunking = {}
local Player = Players.LocalPlayer
local Character: Model = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
-- // Params
local params = RaycastParams.new()
params.CollisionGroup = "RayRoad"
-- // Params
-- // PRIVATE VARIBLES // --
local Limit = 7000
local Back = 5000
local globalConnection = nil
-- // PRIVATE
--// Modules // --
local Effect = require(script.Parent.Parent:WaitForChild("Effects"):WaitForChild("Loader"):WaitForChild("Loader"))
--// PRIVATE FUNCTIONS // --
function chunking:Start()
globalConnection = RunService.RenderStepped:Connect(function()
local hrpPos = HumanoidRootPart.Position
if hrpPos.Z >= Limit then
Effect:ClearVFXCharacter(Character)
HumanoidRootPart.Velocity = Vector3.new(0, 0, 0)
Character:PivotTo(CFrame.new(hrpPos.X, hrpPos.Y, Back) * CFrame.Angles(0, math.rad(180), 0))
end
end)
end
function chunking:End()
globalConnection:Disconnect()
end
return chunking