WalkNavigation MoveBackward not working

For some reason, I cannot get my TCastleWalkNavigation to perform MoveBackward, nor a right strafe. Forward and left strafe work as expected. I’ve tried reinstating a different WalkNavigation to no avail, these are my current settings


An often mistake is that your didn’t enable PreciseCollisions on the TCastleScene that defines your level geometry.

More details:

  • In the future, the PreciseCollisions shall be deprecated and even (further future) ignored. And we have a plan for new navigation components using only physics. At this point, the PreciseCollisions shall be ignored and only the physics colliders (like TCastleMeshCollider) will matter to determine how collisions are resolved.
  • See 2 sections in roadmap: Roadmap | Manual | Castle Game Engine , Roadmap | Manual | Castle Game Engine for more info.
  • Right now, TCastleWalkNavigation relies on a different calculation of collisions. This calculation treats each scene as a bounding box when PreciseCollisions = false, and as a precise set of triangles when PreciseCollisions = `true. See old collisions section.
  • Moreover, we have special code to enable to “get out” of the collider when you’re already inside it. Likely that’s why 2 keys work (forward and left strafe) and 2 keys don’t (backward and right strafe).

If this doesn’t help, please submit a testcase to reproduce the problem, I’ll be happy to investigate more.

Sorry if it’s a stupid question but how would one go about submitting a test case? PreciseCollisions is enabled on ‘Map’ and I’ve tried every little setting I can think of and it doesn’t help at all.
I even decimated the file in blender to see if it was a weird vertices or edges error but that doesn’t seem to be the case.

Basically: send us the project source code, in any way you like. E.g.

  1. Just pack your project into zip, and attach it to a post in this forum.

    You can use the CGE editor menu item “Run → Package Source” command to easily package the sources (without binaries) to a zip. If for some reason you prefer to zip it in some other way (e.g. just using file manager’s context menu to “pack to zip” or command-line zip -r my.zip my-project/) then also go ahead, everything is cool for us :slight_smile:

    If you don’t see a button to upload a file when composing a post on this forum (the button looks like this:
    Zrzut ekranu 2025-02-06 220748
    ) then let me know, I will fix the forum permissions, you should have this button.

  2. Or, if you’re familiar with GitHub or GitLab or any other place to host the project, then create a project there and send us the link.

  3. Or, upload the zip to any file-sharing service (like Proton Drive, Google Drive,
    Dropbox) and send us a link.

  4. Or, create a GitHub bug in our repository ( engine issues ) and attach the zip with project there. You can post in the forum thread link to the GitHub issue.

AD 1 is my most preferred option, because it keeps the discussion contained to this forum thread, and it doesn’t rely on anything “external”. So someone reading this forum thread e.g. 5 years later will have all the links to zip working, and all the information. But, in the end, really all the options to share files are good :slight_smile:

build-0.1-src.zip (1.0 MB)
I never noticed that button, my mistake.

Thanks! Investigating, it seems that PlayerDefault keeps colliding with the camera. Toggle PlayerDefault.Collides (in the “All” tab) to false to make walking work OK:

This is also a TODO to remove it, just like PreciseCollisions. In the future, we should only look at physics colliders, not at anything else. For now, navigation components look at Collides and PreciseCollisions. More information in 13. Old system for collisions and gravity. I know this is confusing, sorry – we have a plan to make it better, for now when you use the TCastleWalkNavigation you need to be aware of PreciseCollisions and Collides settings.

Thank you! I could’ve sworn I played around with that setting but I guess I didn’t. Sleep deprivation is not a fun thing :rofl:

1 Like