- Home /
How to make building affected by wind?
I have a building system where the player places walls, floors, etc. to build a shelter. I want to make it so that these pieces get connected together (fixed joints?). I want these pieces to be affected by wind so that the player needs to make the shelter aerodynamic or something like that, and if it is not aerodynamic, the shelter would be blown apart by the wind. I know this sounds super complicated and I am not asking for people to code this for me. I just want to know how to go about making this. Any help is greatly appreciated!
Are you using physics for this? Also, how does the wind work in your game? Is it a vector field?
Yeah, I'm using the physics engine within unity. The wind in my game is a custom script that I made where it just applies a force to a rigidbody to make it be blown in the wind. Edit: I have no idea what a vector field is, do you think that I should use that instead?
Hm, well when using the physics engine for gameplay mechanics things usually become about feel and adjusting a lot of small variables. You could try increasing the mass of the objects based on how many connected objects they have. You could define rules for various materials. e.g. Bricks would take 100% of the wind force (deflecting the wind). While the staws allow some wind to pass through it. Vector field is a grid of directions (google it). It can allow you to move wind through a maze, as opposed to having a global direction of the wind.