Teleportation Issue

Greetings.

I have a perfectly functioning teleporter script, which teleports me to my desired location.

However;
Upon being teleported to the required area my player character has a slight consistent shaking that won’t stop. The body literally jolts in slight motion. This does not happen where the teleporter itself is.

I’ve heard something about this being because of a part being too far away from the origin?
The teleporter itself is where you’d typically spawn into the studio when beginning a new build. The teleporter teleports you to an area 100,000 studs away from it. I’ve done this to reduce lag as I’m beginning a new section of the project.

Is there a method of fixing this “jolting?”

The teleporter teleports you to exactly 0,0,100000.

1 Like

Which part of the body are your teleporting?

1 Like

Showing the script would help, and make sure you’re doing Character.HumanoidRootPart.CFrame !

2 Likes

Entry = script.Parent
Exit = game.Workspace.ExitPart

Entry.Touched:connect(function(part) 
    if part.Parent.Humanoid then 
        if part.Parent.Humanoid.Health > 0 then 
            part.Parent:MoveTo(Exit.Position) 
        end
    end
end)

`

1 Like

Hmmm… Why are you using :MoveTo instead of CFrame.new?

You should do

part.Parent.CFrame = Exit.CFrame

I also recommend to use FindFirstChild(“Humanoid”)

1 Like

It’s challenging to read the code like this, use this:
image

And don’t use :MoveTo, use CFraming.

1 Like

Right, would this be better?

Entry = script.Parent
Exit = game.Workspace.ExitPart

Entry.Touched:connect(function(part) 
    if part.Parent.Humanoid then 
        if part.Parent.Humanoid.Health > 0 then 
            part.Parent.CFrame = Exit.CFrame 
        end
    end
end)
1 Like

Yes, the :MoveTo function is made for moving whole humanoids to a point.

1 Like

The problem itself isn’t ANYWHERE with your script. It is due to the placement of where your destination is. Anywhere beyond 50k studs will make things like this happen. You can test it out yourself with @Maximum_ADHD’s own place where he teleports players to different altitudes.

1 Like

Yes, something like that should work.

1 Like

Oops, I accidently replied to the wrong dude.
@Souleth
The problem itself isn’t ANYWHERE with your script. It is due to the placement of where your destination is. Anywhere beyond 50k studs will make things like this happen. You can test it out yourself with @Maximum_ADHD’s own place where he teleports players to different altitudes.

1 Like

I suspected as much.

Is lag still reduced if parts are within a 50k radius?

1 Like

Anywhere beyond 3-5k is fine in my experience. I believe I have posted a thread about something similar. That is what we did with Action!, we had MULTIPLE maps with a relatively high part count, and we placed them around 2k apart on the Y axis.

1 Like

It doesn’t fix the jolting, but I suppose I’ve made my code more efficient?

1 Like

Thank you, right now I have a 5000-7000 part section and I’m about to build something that will most likely exceed 8000 in a different section, would placing it at say… 20,000 studs be suitable?

1 Like

@Souleth If you’re trying to increase the performance you could use StreamingEnabled for far distances.

2 Likes

I suggest not placing it in the X/Z axis. Try moving it upwards it is more efficient that way. And 20k COULD still make some issues with your scripts in the future. I’d strongly recommend 2-3k apart if you have multiple maps. But if you have a very big city, maybe a bit further.

//I actually went and confirmed this. Putting anything above 15k will cause issues with animation.

1 Like

Just curious; How did you come to this conclusion?