# Working with thin walls...

Well… The thing is, my game kinda calls for thin walls. The problem is, collision with thin walls is hell (especially when you’re colliding with the width of the wall…) So I just wanted to ask whether any of you guys have any experience with working with thin walls, and how you overcame the collision-ness.

On my end, I’m currently experiencing a problem where when I run into the width of the wall, it will spasm and jump, because its colliding with two opposite sides of the wall at once…

how about using CollisionPlanes? you’d still need some smart triggering for them where your walls end.
small example:

EDIT: since multiple spaces are stripped on this forum software, look here: bpaste.net/show/2364/

how it works:

1. avatar is surrounded by two planes -one is a solid collision wall, pushing you back (pusher), the other acts as trigger. it only deactivates the other plane and lets the avatar pass it.

2. avatar has passed the trigger plane (which is invisible of course). this deactivates the solid wall.

3. since the pusher wall is off, you can go through it, which looks like usual walking through a hole in the wall (or door) for the player.

4. once the player passes the trigger between sector 3 and 4 the wall pusher is activated again

i hope this helps you a bit. have a nice day

I’m more of a theorist than a coder so correct me if im wrong

Id suggest you use collision rays to detect the distance the player is from the walls, probably using 3 or any other odd number which is higher

you would set the closest distance the player can be to the wall

and when that criteria is achieved, your player will not be able to pass through the wall

just asking, how thin are your walls, are they overlapping each other or REALLY close

how is that better than a sphere? a sphere is like an unlimited amount of rays in all directions plus it’s cheaper than firing rays in random directions.

no, the problem with thin walls is less the FROM solid, than the INTO body. you have to prevent jumps between the frames (imagine the avatar is on the one side of the wall in frame 1 and a kilometer behind it in frame 2).
there’s the technique of interpolating the movement of solids between frames (search for fluid transform changes), but i’d say my idea is way cheaper on resources.

ah okay, well again i say, im just a theorist until i get more to understand python and panda

anyway what i thought was that the collision volume of the player character was digging through the 1st wall and into the 2nd wall causing the odd problem

ray at least from where i read should not have this problem since its a ray

As i dont use any autocollide it seems simple to me.
If you collide with the both sides of the wall, then one of the collision points is closer to your last frame pos(last frame cos you could have moved fast enough to almost bypassing the wall), so i would do my collisions based on the closer point and ignore the rest.

But i doubt this will help with automagical collisons.

For the record, Panda3D provides continuous collision detection:
panda3d.org/manual/index.php/R … ng_Objects