Author Topic: Platformer physics problem  (Read 5668 times)

badescuga

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Platformer physics problem
« on: August 07, 2013, 05:16:35 AM »
Hello! I wish to make a NGUI platformer, so i need to be able to add physics to my game. I have some problems with implementing this in unity. I have added rigidbody to each sprite, but that isn't enough. In 3d i also need to add a mesh filter so that the rigidbody is applied to 'something'. How do i do this in NGUI? The sprites don't have mesh filters?

I've done another experiment and have seen that if the sprites have rigidbodies and box colliders and i place a 3d terrain under, they will interract with the terrain (not pass through it) but will not interract with each other (i.e. pass one through another). Why is this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Platformer physics problem
« Reply #1 on: August 07, 2013, 05:17:56 AM »
Physics needs a collider to work with. No collider = no physics, rigidbody or not. With sprites this generally means adding a box collider.

badescuga

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Platformer physics problem
« Reply #2 on: August 07, 2013, 05:42:35 AM »
ok, so why don't my sprites react to each other (i.e. pass through each other) and how can i make this work?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Platformer physics problem
« Reply #3 on: August 07, 2013, 05:46:45 AM »
The colliders must be actual colliders, not triggers. You must also set up the collision matrix in physics properties.

This is a Unity question rather than an NGUI question.

badescuga

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Platformer physics problem
« Reply #4 on: August 07, 2013, 05:50:22 AM »
thanks! the problem was the size of the colliders, it was too small