- Home /
Where to begin on construction simulator: How do I allow the player to snap pieces(prefabs) together?
Title.
I want to start off simply. The first feature I want to implement will allow the player to snap prefabs together. How would I best accomplish this?
Answer by plotnus · Dec 03, 2018 at 12:51 AM
@SFoxx28 Start by breaking down the problem then implementing it piece by piece. Here is a start: - a way to grab and select pieces in game. - a way to move the pieces in game - how the item behaves while being moved (does it ghost through other pieces?) - having the prefabs that will be instantiated and moved. (start simple with a square) - next is how will they snap? You will have to have locations that they connect to. Start with the simplest type of connection, a rigid one. make it work for two squares. Next you can add other types of connections and make it so only certain pieces can connect to others.
Implement the simplest case first. Implement the parts needed for that "simple" case.
I hope this helps.
Your answer
![](https://koobas.hobune.stream/wayback/20220612163402im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I reference a prefab from within itself? 1 Answer
Suggestions for Prefabs which refer to other Prefabs 0 Answers
Unity Programmatically Link Prefab 2 Answers
Prefabs won't change? 1 Answer