- Home /
Ground collapsing where you walk.
Hello I'm planning to create a small game were you can walk around in a small arena. While walking the ground should collapse under your feet. I'm wondering what would be the best approach to do this. I don't really have a lot experience with Unity I made like 2 small games with it. But I'm fine with programming I'm just looking for something that I can do some more research on so I can get started. I'm not really asking for a fully working example I just need some inspiration to get started.
Some ideas I had are:
Modifying the Terrain in unity I saw some things in the asset store that were able to create holes and things in terrain. But I have like no clue how to do this myself.
Using small blocks and generating the arena in a loop and just place a lot small blocks. The only thing with this would be the texturing. Like is there a way I can create like one big texture and that each block only uses xx part of the texture. So let's say I have a texture from 1014 pixels and I put a field of 256*256 small blocks that each block gets 4*4 pixels from the main texture. So basically just some sort of sprite system.
And then the last idea was to use something with voxels and just use 1 big block and use voxels to create holes in the box. But same for this one I don't really have a idea how to start with this.
Once I can modify the terrain I will be fine with doing everything else. I need to get started on this project in 1.5 week and then I only have 2 weeks to create the entire game including modelling. So I hope someone can help me out here.
If there are any questions please let me know.
DO NOT POST CO$$anonymous$$$$anonymous$$ENTS AS ANSWERS.
it's amazing you're doing a "thesis" and you can't handle this simple issue.
Answer by rct3fan24 · Nov 26, 2013 at 07:56 AM
You could have platforms made of boxes that are about the width of the players, or half the width of players, and each one of those boxes could hold a texture. Sure, it wouldn't look perfect, but it'll work.
Then you could use OnCollisionExit to detect when a player has stepped off of one of the boxes, and then have it add a rigidbody to the box, with "Use Gravity" checked, and it'll fall down. (This is just for cool effect...)
Thanks for the answer. I think this will be the way to go. I have started on it today and already have it sort of working. It generates the floors and blocks break where you walk. It's not perfect but it's good enough for a small game. And I will probably just do a tillable texture indeed and then have that texture for each block what I did now. If someone has a good solution for a big texture then I would love to hear about it.
Answer by haim96 · Nov 26, 2013 at 01:44 PM
if you want the player to fall with collapsed floor if he don't move away after few seconds instead of using "OnCollisionExit" you can start coroutine timer that will add the rigid body after say 2sec. if the player still stand on the same spot he will fall with the collapsed floor...
Your answer
Follow this Question
Related Questions
Procedural Mesh random faces generated 0 Answers
How to periodically pull output from an IJobParrallel or is there a better way to do this? 1 Answer
Can someone help me with procedural voxel terrain generation? 0 Answers
How do I see something through a depth mask? 0 Answers
Cut holes in sprite using other sprites 2 Answers