Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improper collisions #189

Closed
justinbarrett opened this issue Aug 15, 2020 · 7 comments
Closed

improper collisions #189

justinbarrett opened this issue Aug 15, 2020 · 7 comments
Labels
bug Something isn't working Fixed in master Fixed on latest Github version but not yet available from the asset library

Comments

@justinbarrett
Copy link

when generating/updating the terrain collider, the collider does not seem to line up with the visual mesh 100%.

  • to note. I am linecasting to set the position of the player, but the collider itself(kinematic ofc) is still intersecting.
    This is sometimes above the mesh as well, not just below.

If this is something on my end, please let me know..I'm unfamiliar with the addon and was just checking it for feasibility on my next project.

To Reproduce
0) using either default or bullet physics backend

  1. simply creating a new terrain
  2. do some slight modification to it's height using the supplied raise/lower brushes
  3. save, start engine and walk up a hill
  4. feet will intersect with the terrain...sometimes up to half the torso. OR collide offset from the terrain.

The project is not on svn/git or any repository yet...just doing testing, but the file is already to large even zipped to upload here.

no console errors.

Not to be rude, I thank you for this contribution..but I think the expected behavior is clear :)

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • win 10 64
  • rx 5700 xt
  • Godot 3.2.2 64
  • Plugin version 1.3.3
  • Renderer GLES3
@Zylann
Copy link
Owner

Zylann commented Aug 16, 2020

There is a possibility of very mild intersection, due to the fact Bullet uses Z-shaped collision, and the terrain uses X-shaped geometry to render, but this should be barely noticeable, unless you have a crazy low resolution or very distorted height variations. It could also be a LOD problem. I'd need screenshots or a test project to verify your issue.

@justinbarrett
Copy link
Author

I'm not wanting to waste your time with this. I will set up a new project and upload it tomorrow...it's evening here in germany and I am getting the children ready for bed.
BUT: I think this has more to do with linecasting(not Raycast3D, spacestate scripted linecast) than kinematic collisions, as I have not set up any jumping mechanics and am using a linecast to directly influence the players height from the collided surface with an offset(constant offset).

as I said, I will put a new project together tomorrow and upload it.

@justinbarrett
Copy link
Author

Looking at it further while creating this little project..seems it has to do with changing the map scale..via the terrain properties "Map Scale"...at 1,1,1 it's fine...after that is changed it acts awkward.
terrain_test.zip

@Zylann
Copy link
Owner

Zylann commented Aug 18, 2020

Your terrain has indeed an extremely low resolution relatively to your character. Even if the problem is fixed, there will still be mild intersection.

Collision scanning reveals that the collider is offset by half a cell:
image

Even stranger, it doesn't even cover whole area when the scene loads (that gets fixed by "update editor collider", although not sure why). That's also a bug because it should be correct out of the box:
image

Note, in your test project the character's collision box doesnt have the same size:
image

@Zylann
Copy link
Owner

Zylann commented Aug 18, 2020

I managed to fix the offset in 528540f .
The second issue in editor is related to #129, and it doesn't happen in game.

@Zylann Zylann added bug Something isn't working Fixed in master Fixed on latest Github version but not yet available from the asset library labels Aug 18, 2020
@justinbarrett
Copy link
Author

I have used the "update editor collider"...it had no effect..still thank you for looking at this and I understand it is resolved in master. I did increase the resolution and it did help AFAICT.

@Zylann
Copy link
Owner

Zylann commented Aug 18, 2020

I have used the "update editor collider"...it had no effect

It does have an effect on the second issue I mentionned above, not on yours ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed in master Fixed on latest Github version but not yet available from the asset library
Projects
None yet
Development

No branches or pull requests

2 participants