Center an probuild object on it's origin

Hello everyone !

Let me hit you with some details :
My team and I are trying to create a labyrinth game made with diffrent rooms etc.

I created different rooms with probuilder and manually placed the origin of object on the center of the room.
The problem with that is that I'm not a machin and of course I made mistakes and it creates a tiny tiny tiny offset that is super unsatisfying.

THAT kind of offset you know.
6910469--809870--upload_2021-3-7_19-8-34.png

And right now I think I have only one solution witch is to recreate all the rooms and use progrids to help me position everything.

It would be tidious and time consuming, and I wondered if there was a solution out there able to "center" the probuild object on it's origin.

I hope you will be able to help.
Thx a bunch for your time.
Have a nice day.

[quote=“unity_971devinou”, post:1, topic: 831693]
And right now I think I have only one solution witch is to recreate all the rooms and use progrids to help me position everything.
[/quote]

It’s a tough call… I feel your pain.

Using the ProBuilder API you might be able to grab all the verts in your pieces and align them to be quantized to whatever grid position you want them to be. A little bit of scripting might go a long way. Let’s say you want every vert to be on an integer position in the X and Z direction, and on the 0.5 position on the Y: you would iterate them all, adjust them all, and resave the prefabs.

Then you could look them over by hand, and that might take care of 90% of the positions, and then you can hand-touch up the last parts of it, using ProGrids to snap the last few verts into position where they belong.

WHATEVER you do, do not proceed without first either a) backing it all up, or b) duplicating everything to test objects, or c) having proper source control and branching to be safe from damaging your original work.

1 Like

Thanks for your answer.
I'll do my researchs on the ProBuilder API.

I use the collaborate package to work with firends, so there is no problem there, we will be able to go back to an old version if needed.

If the ProBuilder API turns out to be too hard for me to use, I guess I'll just have to recreate the rooms.
It'll be time consuming but at least I now know enough about probuilder and progrids to avoid this kind of mistakes.

Have a nice day.

[quote=“unity_971devinou”, post:3, topic: 831693]
I guess I’ll just have to recreate the rooms.
[/quote]

Let me offer you this consolation prize: personally I hate redoing work in this fashion, but I find that every time I do, I end up making it WAY BETTER the second time around.

I know, it sounds cheesy to look for the bright side, but it seems in this case it just might offer you such an opportunity!

All the best!

1 Like