x


Problems With IgnoreCollision

I have a player object which 'inflates' when tapped, specifically the scale for x and z increases and then decreases. This inflation is used to bump a ball around a field. I have a sphere collider attached to the player object but unfortunately the sphere collider scales in all directions. This results in the player 'bumping' into the air. A mesh collider works but the performance hit on an iPad is too great when I add a bunch of players. I came up with the following solution but unfortunately it doesn't work as planned.

If I put the following code before the scale increase

Physics.IgnoreCollision(Field.collider, collider, true);
        rigidbody.useGravity = false;

and this code after the scale increase

Physics.IgnoreCollision(Field.collider, collider, false);
        rigidbody.useGravity = true;

I don't get the player bump but the ball doesn't inherit the momentum of the bump. It merely gets pushed out of the way and then returns to its previous speed.

Any suggestions on how to fix this?

more ▼

asked Feb 05 '11 at 01:46 AM

shawnpigott gravatar image

shawnpigott
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1795
x1704
x388
x360
x38

asked: Feb 05 '11 at 01:46 AM

Seen: 744 times

Last Updated: Feb 05 '11 at 01:46 AM