Collisions not working

I have the same problem. I have no idea why the collissions are not working.
As a matter of fact, I am following @Thaumaturge 's tutorial on Lesson 6 (Lesson 6 | Panda3D Beginner’s Tutorial).
I have the exact same code as given in the tutorial and it still won’t collide.

What is it that the OP and I am missing.

If your code is exactly the same as the reference code for the tutorial, then the problem that you’re encountering is, I would expect, different to that which the Pozz is encountering.

As I replied to the Pozz, their problem is essentially that they’ve renamed the variable that holds their traverser.

But the reference code for the tutorial doesn’t do this–it uses the built-in variable “cTrav”.

And indeed, double-checking the code quickly on my end, it seems to work as expected!

So, given this, could we please see your version of the code? Perhaps there’s a discrepancy there that will reveal the source of the problem for your case.

Hey @Thaumaturge, thanks for getting back to me so quickly.
I am pasting my code here.

Also, thank you so much for the tutorial

The tutorial is my pleasure–I’m glad if it’s proving helpful! :slight_smile:

As to the problem that you’re seeing, looking over your code it seems that the problem is that you’re placing the character at a z-position of 7, thus placing it rather higher than your walls. The collider–which is attached to the character, and which is thus also shifted upwards–thus passes over the walls, and so never collides. If you comment out the line that sets that z-position, the collider seems to collide as expected.

1 Like

Thank you so much, that really fixed the code and I am able to work with collisions.

1 Like