- Home /
Building blocks
Hello everyone. I doubt this can be done easily but hopefully someone can nudge me in the right direction. I have some rigid body's representing building blocks that can be dragged around to build things but the problem is as of now it's kind of difficult because there's no way to raise/lower the blocks so they ca't easily be stacked. Also the RigidBodyDrag is kind of slow and inaccurate. Does anyone have some suggestions on ways to achieve the simulation I'm looking for?
Edit What I decided I want to do is drag with the mouse, and raise/lower the objects with the up/down cursor keys.
Answer by Adamcbrz · Aug 05, 2011 at 03:54 AM
RapsFan,
This is a very crude prototype. There is a lot of things that could be improved/fixed. But I hope it gives you a starting point for your project.
Answer by Adamcbrz · Aug 02, 2011 at 10:06 PM
One option is to drag with the mouse like you mentioned and use code to determine when to change levels. So if a block is at level 1 and you collide with it then move to level 2 and so on. I am assuming that you are stacking directly on top in some sort of grid layout. So blocks stack directly on top of other blocks. Let me know if that doesn't make sense.
Thanks for your reply Adamcbrz. I'm not using a grid. Basically the player had a collection of blocks that that can move around to build a toy soldier base. I wanted to make it as free as possible to that the objects aren't confined to a grid but can be arranged in any way.
What's the best way to create a grid? A plane for each grid space?
That is a way but it seems more flexible and efficient to do it using code. I will try and through an example up in the next few days.
Your answer
![](https://koobas.hobune.stream/wayback/20220612164135im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Make a rolling ball always on ground without falling when reaching the edges of the map 1 Answer
Freezing movement on Z axis. 1 Answer
simple thing I can't get right (see picture) 0 Answers
Motion working not properly in simple pendulum 1 Answer
Calculating flight time with starting velocity and drag 1 Answer