PivotTo teleporting model to the wrong position

I am making a dungeon generation system for my game, when I used PivotTo to spawn rooms, sometimes they will appear at a large offset and/or stacked on top of a previous room.

The pivot points on all models are perfectly correct, and the cframes should be completely fine. Does anyone know why this is happening?

Additionally, I did do a print test and it said that the position it got teleported to is not the target position.

Result:

Expected:

1 Like

Without a code sample to review it will be difficult to diagnose exactly the issue.

My guess would be, the stacking is due to models being cloned and parented to the workspace where an existing model is. And in both stacking and offset issues, it sounds like PivotTo isn’t being called correctly, or at least not at the right moment when generating the models, so it is moving the original then creating a clone for example.

1 Like

You could try using .CFrame instead of PivotTo(), although I’m not sure if this would work, since you are moving large rooms.

1 Like

Make sure your model has a primarypart.

1 Like