2

I have problem with this object's collider. Cannot find 3D collider for this floor. I cannot use 2D collider because my player is 3D player. When i put 2D collider, my player is falling. What should i do for it ?

I created half triangle and made it mesh collider. But it did not be succestful.

derHugo
  • 83,094
  • 9
  • 75
  • 115
Elenor
  • 65
  • 1
  • 6
  • Just use a box collider, or mesh collider (more cost but for something that simple it should be fine) – Jichael Jun 05 '19 at 07:49
  • I'm lookıng 3D collider for ramp. Can i turn the box collider into half triangle? Because when i put box collider it does not work so well. – Elenor Jun 05 '19 at 07:59
  • You could add a child to your triangle, rotate it 45° and add the collider to it, so it would fit your ramp. But again, for something that simple, you can use a mesh colider (check Convex) – Jichael Jun 05 '19 at 08:09
  • `Collider2D` don't interact with `Collider`(3D) ... the Physics2D and Physics engine are completely separated – derHugo Jun 05 '19 at 08:17

1 Answers1

1

From the picture it looks like you're making a game with 2D perspective.

If you're making a 2D game it doesn't matter if the player uses a 3D model, it can still use 2D physics since you're not using the 3rd dimension.

My advice would be to change all the colliders to 2D colliders and use a Polygon Collider 2D component for the slope (triangle) object. This should adjust the collider shape to your sprite.

Don Andre
  • 932
  • 1
  • 5
  • 24