x


Mesh collider cost

Hi there,

I'm creating a 2d melee game, star control style, and wondered if mesh colliders for the 2-4 players (and sphere/capsule for everything else) would be too expensive for the iphone? Are there any other drawbacks with mesh colliders that I should be aware off (e.g. will it make a bounce unpredictable when colliding with some other mesh?)

Thanks Mike

more ▼

asked Oct 18 '10 at 10:57 PM

runonthespot gravatar image

runonthespot
514 19 21 36

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

1 answer: sort voted first

Is there any reason for using mesh colliders? Typically, dynamic objects use primitive colliders, or compound primitive colliders if a single one isn't accurate enough.

more ▼

answered Oct 18 '10 at 11:12 PM

Eric5h5 gravatar image

Eric5h5
80.2k 41 132 519

Not really, beyond wanting enemies projectile hits to be accurate and not register false positives- Imagine a Klingon shaped (crescent) ship- a capsule would cover it all, but be quite inaccurate?

Oct 18 '10 at 11:19 PM runonthespot

mesh colliders don't collide with each other anyway, it seems, so I think compound is the right answer, thanks!

Oct 18 '10 at 11:32 PM runonthespot

Mesh colliders will collide with each other if they're marked convex, but that has various limitations (like, the shape must be convex), and compound primitive colliders are still faster.

Oct 18 '10 at 11:56 PM Eric5h5

that's fine. I found elsewhere that adding child objects with primitive colliders is the way to go and even though you have to attach the collision script to each, it only fires the script if a collision occurs, so there is no additional overhead. I spent the evening deciding which of the primitives to use to capture the collisions for each ship.

It's a shame there aren't more primitive shapes available-- especially with triangular shapes, as the capsule, sphere and box colliders don't always fit that well.

Oct 20 '10 at 09:41 AM runonthespot

@Mike: you don't need to attach a collision script to each, only the parent object.

Oct 20 '10 at 04:35 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x1956
x1686
x1357
x1034
x662

asked: Oct 18 '10 at 10:57 PM

Seen: 2412 times

Last Updated: Oct 18 '10 at 10:57 PM