Hello Guest

Author Topic: Collision data without rigidbodies?  (Read 3991 times)

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Collision data without rigidbodies?
« on: February 16, 2013, 08:33:43 pm »
I was wondering how currently 2dtoolkit manages collisions without rigidbodies. At least with my present setup, the tilemap accounts for the main character's controller collisions without a rigidbody on either.

But now I'm stuck because my main player character doesn't respond to OnCollision, and I suspect will not collide when testing with OnTrigger.

So do I need to add rigidbodies just to access collision data? A gripe of mine actually is having to add them at all, when collisions seem fine (characters with the tilemap)

Any tips or help are appreciated.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Collision data without rigidbodies?
« Reply #1 on: February 16, 2013, 08:37:05 pm »
You should really have a rigidbody on any moving collider. You don't need a rigidbody on the tilemap, but almost certainly on your player character. Once you create your character / character prefab, add a rigidbody to it.
Or you could use a character controller on the player - it might be easier to do it that way.

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Collision data without rigidbodies?
« Reply #2 on: February 16, 2013, 08:39:58 pm »
Yes I do have a character controller on my player.

Ok thanks, I was just interested in how detailed collisions are working in 2dtoolkit I suppose ;)

For now I'll take it as "automagic".

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Collision data without rigidbodies?
« Reply #3 on: February 16, 2013, 10:08:16 pm »
It's not quite automatic as it just uses the unity physics engine. (physx)