Why are players going through my build when being teleported

Issue I am having on what I am building is the vent tunnel I am making. I got teleporters which teleports players into the vent tunnel. It works perfectly fine, except sometimes for some reason a player would get teleported on top of the build and not inside the vent tunnel. (Players are not even on top of each other and are NOT being teleported on top of other players as I am only testing this with myself so far and is noticing this issue) Pics of the tunnel

Any fixes except for rescaling the height of it as I don’t really want to change that.

(Players are not too big for this either as I am the only one testing this and sometimes it works perfectly other times it doesn’t and I get teleported on top of the tunnel.

1 Like

Well, first of all, make sure can collide is on for the vent parts.

The only reason I can think of why this happens sometimes is because of how the teleport system works. Is the player getting teleported to the correct cframe of the part you want them to go to?

Also, can the player fit in the vent without issues?

In the pics above the player is being moved to the gray part in the vent using Moveto function. The players have no issue with fitting in the vents. And yes cancollide is on.

plr.Character:MoveTo(Workspace.PartZ.Position)

I wonder what’s causing this issue :thinking:

Try setting their CFrames. MoveTo isn’t precise.

2 Likes

I would try it with setting their CFrames and a little offset with Vector3 so the player doesnt spawn inside the part.

1 Like

Use PivotTo instead of MoveTo, and change the parameter so it doesn’t error

@Geolio9 @BlxIsHere

Alright I usually use MoveTo so just double checking like this:

local playerCharacter = plr.Character
local partPosition = Workspace.PartZ.Position
local offset = Vector3.new(0, 5, 0)  

local newPosition = partPosition + offset

playerCharacter:SetPrimaryPartCFrame(CFrame.new(newPosition))

This seemed to have fixed the problem --Thanks

1 Like

PivotTo should be the same as SetPrimaryPartCFrame in this situation. Also didn’t I just say this as well?

You stated

The other person told me to use the Vector3 which seemed to have helped alot, but is still using cframes like you suggested.

Now what do you mean by PivotTo should be the same as SetPrimaryPartCFrame in this situation? You want me to change SetPrimaryPartCFrame to pivotTo?

Sorry I wasn’t clear. PivotTo should be the same, and it’s not deprecated. (SetPrimaryPartCFrame is)
It accepts the same argument, so you should just be able to change it.

1 Like