Hello Guest

Author Topic: Rigidbodies falling through tile map mesh colliders  (Read 4120 times)

Neeko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 59
    • View Profile
    • Overdeveloped
Rigidbodies falling through tile map mesh colliders
« on: May 31, 2014, 01:12:11 am »
I'm having an issue with rigidbodies easily falling through the mesh colliders of a tile map (not always, but usually). I've read http://2dtoolkit.com/forum/index.php?topic=3039.0 and the recommendation then was simply to use Physics2D, which I did do, but it actually made the problem worse.

I'm curious if there's anything else that can be done? I have the collision detection mode set to Continuous, which according to the Unity docs should detect collision for any static mesh geometry.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Rigidbodies falling through tile map mesh colliders
« Reply #1 on: May 31, 2014, 07:07:32 pm »
Continuous has never really worked as I expected. If its falling through, then perhaps you're moving the rigidbody too quickly? Or the scale is too small, etc. Try various settings (speed related) to see if you can improve it. Also, if you're moving it in code, make sure you're doing it in fixed update and using rigidbody.moveposition and not modifying position directly.

Neeko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 59
    • View Profile
    • Overdeveloped
Re: Rigidbodies falling through tile map mesh colliders
« Reply #2 on: May 31, 2014, 07:44:44 pm »
Doubling the scale (1 to 2) did seem to fix the issue, but now the sprite is double the size which I don't want either.

The sprite is moving fairly slow and I'm not moving it via code so it does seems to be an issue with the scale. I guess I'll have to play around with it to find the optimal scale without having the sprite seem too big (if possible!).

As always, thanks!