0
\$\begingroup\$

So I'm working on this game that I came up with the idea for while watching the Unity Roll-a-ball tutorials. So it's probably important to note that I'm extremely new to game design and I don't have a whole lot of experience in programming.

So the game idea that I had is a lot more complex than what it should be for someone who's pretty much completely new to game design, so I guess I'm trying to break it down into smaller bits until I have enough experience to build it into a cohesive game.

Currently what I want to work on is a game where you play as a sphere rolling down a plane with open edges so you can fall off. There are walls that you have to avoid, and if you run into them it will take away from the space between the walls and the edge of the plane. I guess I was sort of thinking of having a sort of similar visual style as bastion in that sense.

The way I thought I would go about this is to break the plane up into smaller squares and then do some programming so that when you run into the walls the smaller squares at the edge of the plane fall off. Though before I could even get to programming I ran into a big problem. Because of the way Unity physics work and the way I built the ground, the player collision with the ground is god awful. When I was just testing it with some basic controls the ball would roll all choppy and if I picked up enough speed it would start to jump. I assume this is because it's colliding with all the edges of the grid system that I built.

Does anyone know of any way I can program the edges to not interact with the player? Or if there's a better way to go about doing this?

\$\endgroup\$
  • \$\begingroup\$ You could procedurally generate your level as a mesh with a mesh collider... You could also use a polygon collider for the whole entire level (or at least large chunks) \$\endgroup\$ – Savlon Mar 10 '15 at 23:41
1
\$\begingroup\$

The best way would be to use a single mesh/collider for your ground and scale it as needed. If that's not possible due to the layout of the level, you could place a single transparent plane with a collider slightly above your grid plane and use that as your "floor" (scaling it down to match the grid underneath). you could then remove the colliders from all of your grid pieces and save some performance.

\$\endgroup\$
  • \$\begingroup\$ If I did this would individual tiles be able to fall off? I don't know of any way I can disable individual areas of a single mesh collider \$\endgroup\$ – Josie Thompson Mar 11 '15 at 0:58
  • \$\begingroup\$ You would have to scale the single collider. If you wanted individual tiles that couldn't be represented by a single mesh (i.e. irregular tiles falling away) then you could still use the single collider as your rigid body floor, then assign your tiles a collider and a tag "tile"... then raycast down from your ball to see if it's over a tile. If not, turn off the main "floor" collider and let it fall. \$\endgroup\$ – Mike in SAT Mar 11 '15 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.