Hello Guest

Author Topic: Static Sprite Batcher, Collision Problem  (Read 5916 times)

adscott1982

  • Newbie
  • *
  • Posts: 4
    • View Profile
Static Sprite Batcher, Collision Problem
« on: September 12, 2012, 12:24:55 am »
I am just starting out and I have made a scene with ground sprites and a rock and a crate. All sprites have appropriate colliders. The rock and the crate have rigidbody components.

When the ground sprites are not part a static sprite batch the rock and the crate collide correctly with the ground.

When the ground sprites are part of a static sprite batch the crate correctly collides, but the rock passes straight through! What is going on?

Another query: I have correctly set the rock polygon collider, but when it rolls, it seems that the centre of gravity is completely incorrect. If you can remember, the rock has a large base and a thin top. The centre of gravity seems to be closer to the top than the base, this makes the rock more inclined to roll onto its top than would be normal. Is there a way to modify this?

adscott1982

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Static Sprite Batcher, Collision Problem
« Reply #1 on: September 12, 2012, 12:32:00 am »
Just a note on the centre of gravity, I appear to have fixed it by modifying the anchor point in the Sprite Collection.

adscott1982

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Static Sprite Batcher, Collision Problem
« Reply #2 on: September 12, 2012, 01:00:14 am »
I appear to have fixed the problem with the rock passing through the ground. Since the rock had a mesh collider, and the static sprite batch did too (?) then convex needed to be set on the static sprite batch for collisions to work.

Weirdly, when I try to set convex on the collider for the Rock, it becomes unset after I run the game.
« Last Edit: September 12, 2012, 01:10:02 am by adscott1982 »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Static Sprite Batcher, Collision Problem
« Reply #3 on: September 12, 2012, 01:49:36 am »
You should tick it in the spritecollection editor and commit. That should keep the setting permanent.

adscott1982

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Static Sprite Batcher, Collision Problem
« Reply #4 on: September 13, 2012, 09:56:37 pm »
Thank you Unikron!