Ok, I am interested in creating a platformer game.
Now, I know that Unity can create 2d games, where my sprites are simply textures on planes etc and some help with Sprite Manager 2.
But I don't quite get it.
How do I check for collision between two planes? I mean... seriously...?
Naturally, there is gravity in my platformer game world. So objects like the player himself can fall.
If he hits a platform, won't his whole sprite suffer common collision effects like bouncing? Bouncing would cause the plane to, dunno, rotate or end up in a weird position, no?
Then my player runs... And hits a wall. Now there's another collision, the whole plane's Z position might increase and that means the player would fall to oblivion since all planes have 0 (or 1?) depth?
You don't check for collisions with planes, you use box colliders or whatever else is appropriate.
Bouncing would cause the plane to, dunno, rotate or end up in a weird position, no?
No, you turn on Freeze Rotation. Depending on what you're doing, it might be better not use the physics engine at all, and just do your own.
in the function update you can make the objects fix their xy position and rotation, making this objects to only work on XY planes
gameobjectX.transform.position = new vector3(gameobjectX.transform.position.x,gameobjectX.transform.position.y,0);
//and to correct the rotation on x and y correct those values to make it 0, meaning no rotation on those
if(gameobjectx.transform.eulerAngles.x != 0)
if(gameobjectx.transform.eulerAngles.y != 0)
with position the objects just move left right up down
and with the rotation the objects just rotate on the 0, 360 degrees you see from the front
hope this helps
thanks to eric for the correction