x


Collision problems with level design

Hi there,

I have:

A Level: Modelled & Textured in Cinema4D R11 - saved as FBX and placed into Unity. This model has a mesh collider attached with the appropriate mesh.

A Character: For test purposes i'm using the FPS Character prefab that comes with the Standard Assets. I have made sure that the Player Controller is in the right place and the skin is set to 1.

However my problem is that this character can walk straight through parts of the level if hit at the right angle or if heading towards a slope without jumping it will go straight through. I also have fairly large 'tree roots' that lay on the floor accross a path however the character can walk through those also.

Anyone have any tips? would be very handy!

Thanks.

more ▼

asked Apr 29 '10 at 01:07 PM

Jack Eaves gravatar image

Jack Eaves
235 12 12 26

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

1 answer: sort voted first

Some things you can try:

Only do movement in FixedUpdate so that it's in step with the physics simulation (not really practical but an option)

Move your character with velocity instead of transform.position as you might end up inside the terrain if you move too fast horizontally into a slope.

Decrease the fixed time interval to make physics calculations more frequently per frame, this will help stop your character from going through things if it's moving too fast.

Use a different collider, either box or capsule as mesh colliders are more prone to getting stuck in things, also it'll be faster. If you're using a mesh collider make sure it's set to convex otherwise it wont collide with other mesh colliders.

Place box colliders in the terrain where clipping is likely, this will act like reinforcement for areas with an odd shape. Typically developers will place invisible walls around areas where the player isn't meant to go, that's perfectly fine so long as it's not too obvious to the player.

more ▼

answered Apr 29 '10 at 03:31 PM

spinaljack gravatar image

spinaljack
9.1k 18 31 91

Thank you! I'll give these a shot. I may need to break the mesh down and use box colliders for each object instead of 1 mesh collider for the whole thing, more work but hopefully make it more playable. Also gonna try that invisible wall idea, might help to save some more time for the parts that don't really need to be used.

Apr 29 '10 at 03:45 PM Jack Eaves
(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:

x2499
x1703
x322
x76

asked: Apr 29 '10 at 01:07 PM

Seen: 1672 times

Last Updated: Apr 29 '10 at 01:07 PM