Giter Site home page Giter Site logo

godot-character-controller-example's People

Contributors

alexjhetherington avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yahkub-r iboonie

godot-character-controller-example's Issues

Large safe margin makes flat ground consisting of many colliders "bump"

low safe margin (e.g. 0.001) fails to handle some complicated intersection geometry, but otherwise works very smoothly
high safe margin (e.g. 0.01) handles complicated intersection geometry really nicely; but struggles with flat ground consisting of multiple colliders

My philosophy:

  • Safe margin is a trade-off; it is acceptable that different safe-margins perform relatively well based on the given world geo
  • Flat ground consisting of multiple colliders is a special case and should work regardless of safe-margin

About the solution:

  • is there any unacceptable behaviour in the vertical phase?
  • if no, likely due to depenetration - manually depenetrate?

Website links to GitHub files are broken

Not that it's too important, but I was going back through this today out of curiosity and figured you might want to know the references to your files here in this repo are invalid now on the website.

Getting stuck on door frames

Hi, there. I've been trying out this controller in my project and I'm quite happy about it, it's working great, except for this one thing: sometimes I get stuck on door frames, as in the gif below. I am using Jolt physics, btw.

This seems related to the collision cylinder height, though. The cylinder in the gif below is 1.8 high and my doors are 2 meters high. I tried smaller cylinder sizes, and at 1.6 high I didn't have this issue anymore.

I recreated my door frames with CSG boxes just to see if they would behave the same as my trenchbroom geometry, and they did. To reproduce it, all I have to do is walk into the door frame and keep pushing W while it slides into the open space. Most of the time it won't enter the open space, like in the gif.

fps_controller_door_bug

However, I tested this in your demo project and the behavior was a bit different, for some reason (maybe something I changed in mine). Instead of sliding like in the gif above, it gets stuck to the corners of the CSGBoxes. But this still seems related to the collision height, as lowering the cylinder height made it stop getting stuck (and I had no issues at all with the pillar on the right, in the picture below).

fps_controller_door_bug_2 gif

Having a couple problems with jumping over obstacles

(My version of the demo project is attached below.)

I found two issues with jumping over things, which may be related to the stepping code. I added some boxes to the test map. My jump code is fairly simple, just add jump_force to the desired_vertical_velocity.y when space is pressed.

Jumping mostly works fine, except that when hugging an obstacle, pressing forward into it and jumping:

  • there's a bit of a bump in the movement, when the player reaches the height of the orange boxes (not very noticeable in the gif)
  • the player will stick to the red box as if it was a stair step. As in, the jump will be cut short, at that height.

fps_controller_jump_bug_2

The second issue may disappear by changing the step_height or the jump_force. It seems to only happen under some circumstances, and with the current settings the red box is the only one with the right height for it to happen. But the first issue seems to be always there, except on smaller obstacles, like the white box.

Here's the demo project with jumping. It's a bit bigger because it already includes Jolt, and TBLoader, another test map and a few textures.
godot-character-controller-example-main.zip

The few changes I made to the code all have the comment # (skaruts), to make them easier to find, if needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.