2D sprite with rigidbody - movement stalling in 3D environment

As a learning experience, I’m trying to put together something that looks like Legend of Dungeon, which is a 3d isometric (I’ve read some the developers blog posts so know it is) world with 2d sprites.

I’ve given my empty player object a sprite renderer and changed the material to sprite-diffuse for dynamic lighting. I’m moving the player with transform.translate. I’ve got some coloured lights in there and it looks and works smoothly. Apart from I have no collision control yet.

So… I add a 3d collider (which I’ve read elsewhere is the way to do it), but it’s not actually colliding with my 3d scenery (which at present are just cubes with box colliders) it just passes through them .

So I realise at this point that my player also needs a rigidbody, right? So I do that and change my code to use:

rBody.velocity = new Vector3(horizontal * speed,0,0);

in FixedUpdate(). Where horizontal is GetAxis or GetAxisRaw. All as per the Unity docs.

Problem: it moves as before but randomly freezes the motion, as if the player has become stuck. it only gets moving again with random wiggling of the horizontal axis. I’ve tried several times removing and recreating the problem and it happens every time. There aren’t any other factors or assets in there to affect project.

What am I doing wrong??? Alternatively, how should I be handling movement and collisions in this scenario?

I personally would use 2D colliders for a legend of dungeon type of game, as this is what I’m comfortable with. When in 2D you should still use velocity (via the rigidbody2D component). The reason for using velocity rather than translation is translation doesn’t work as closely with the physics that Unity has created.

As far as possible problems, I’d imagine your Z axis could be off, possibly the collider isn’t set up properly, or maybe even the collider itself is rotating. Without knowing a fair bit about what you’re doing, it’s really hard to say. Perhaps showing how your scene is set-up along with full movement code would result in a better answer.

PS: You say random wiggling, so I’m thinking this is a rotation issue. Lock rotation on the axis causing you trouble and see if that works. If not, repost with more information please.

Here’s the official answer from Unity.

I logged it as bug and after looking into it, this is the reply I received. I thought I would post here as I have read many posts about users having similar issues, but they never seem to find an answer. Here’s why:

It is not designed in any way to be like this, but there is no good way to fix it besides changing world geometry. In fact, this is a long standing issue.
Quote from what one of our developers said:

“Putting colliders side-by-side may visually seem as if they’re continuous from the gizmo rendering POV but from a numerical perspective, it isn’t a continuous surface. This causes the colliders to catch. Sliding a collider over this surface (such as a Box) would cause the collider to catch on an edge. This is a well know problem and isn’t a bug, it’s just the way the solver works.”

You could also check this site, even though it is covering from a 2D standpoint, the main idea stays the same.