r/UnityHelp • • Mar 04 '22

PROGRAMMING I need help starting assembly / disassembly system

I am interested in making a system similar to World of Guns, where you disassemble / assemble models such as toy cars. But I am stuck on where to start.

For instance I have a model which has all the individual parts, I have a system in place for interacting with each individual part ( gives a model name, and details ) but I am completely stuck on where to go next.

The aim is to build a model plane / car and then paint & add stickers to the models. Any help would be greatly appreciated

Edit: if you've ever built an Airfix kit you'll know what I mean, I want to bring Airfix kits into the gaming world as this is all I did as a kid. And I would love to make a game where you have all the Airfix kits ( I know this is a big undertaking but I love Airfix )

2 Upvotes

5 comments sorted by

1

u/Bonejob Code Guru Mar 04 '22

Do you have a process to store the individual models in a structure that can be assembled and disassembled? Have you decided if you are creating animations for each part for attaching a detaching or are you going to program movement using the unity animation system with code?

1

u/[deleted] Mar 04 '22

I was thinking of using unity for the animation, now that I think of it. I'll have to model individual parts and build it up through code, then reversing this to create the "disassemble". Once I've got a simple demo working I'll update this post.

But yeah it looks like I'm going to have to build a config file up for each model, and have them " hidden " when removing a piece and put into an inventory system or something.

1

u/Bonejob Code Guru Mar 04 '22

I would recommend having a connection hierarchy and using a text format like JSON, or if you want to go to the trouble SQLite or the like.

This way you can have a part A before Part B and then part C or even connect part A to B then attach the assembly to C. Easily changing by just modifying the text file. Will make updating a bunch easier.

I recently saw a game where you build models on Steam

https://store.steampowered.com/app/1164250/Model_Builder/

Is the kinda where you want to go?

1

u/[deleted] Mar 05 '22

Yes it seems like I'm going to have to create a hierarchy, but maybe not as direct as part a to part b, as most models would have several part a's if you get me. I saw another game that is similar ( not the one you linked, maybe an older version of it? ) But from what I remember the game was lacking in models, also it would be a good learning excercise for another game idea I have. But yes that's the system I want to create :) thank you

1

u/Bonejob Code Guru Mar 05 '22

No worries, let us know how it is going. :)