Hello,
I want to make a game with a similar graphic style as castle-crasher, and I’ve been having problems with how to do the collision/movement, and whether I should do it in Unity2D or Unity3D. Right now using Unity3D for this would be the easiest thing to do I think, but I’m convinced that I can do this in unity2D, but I have no clue where to start off with.
Can anyone help me with pointers on how to start with collision/movement or point out some videos that explain this.
Thanks.
There is no such thing as “Unity 3d” or “Unity 2d”. There is just Unity.
Terrible answers aside, jumping into unity with an ideal game to make is a double edged sword. If you don’t have a general idea on how to make something happen, nobody will give you advice on where to move forward. I’m not very experienced with 2d platformers in unity, so this information should be taken as guidance, not law.
First, you need to start with a 2D platformer. No forward/backward movement just yet. Try to get a sprite to move left and right, maybe a little jumping action. When you have movement down, try to get side-scrolling involved. No sense playing in a single screen, we need a long road ahead! Now that you have a field you can run around in, you’ll need to start working on some attack animations and controls. Just something really simple at the start like a “swing weapon”. when your character swings this weapon in response to the attack key, and it can’t be re-pressed until the end of the animation, etc, you can create colliders for the weapon. How these colliders are done in 2D i’m not completely sure. I know there are various methods of doing so, I’ve created custom colliders in 3D environments for various purposes.
After you have that all down, it gets a few stages more difficult. You need to allow your player to move vertically, while staying “grounded”. Essentially, you’re emulating 3D environment space with 2D. Position X, Y, and Height-offset, or Z. your character can move anywhere left or right on X, and only in the depicted bounds of Y, and any distance greater than ground when Z is concerned. Although you have a Z coordinate, this doesn’t apply to your Z world position. This is a Y-offset to lift your character off the ground on a 2 dimensional plane. Note, you may also need to create a small algorithm for Y to layer into the Z distance for sprite depth (player in front of another player). As you can tell, this gets very intricate and we don’t even have enemies yet.
Still interested? I suggest you buckle up and work on very small functions until you get the hang of things.
You’ll probably find it easier to do it in 3D. There are plenty of tutorials and such for specific features in you game. As @komak57 said, you should probably break it down into several sections and work on each. If you have not yet, you definitely check out some of Unity’s tutorials then take pieces that they give you and adapt to your game.