gamecreator Posted January 18, 2019 Share Posted January 18, 2019 Two issues (4.5 release): 1. I took the SetInput example code and added a jump and set the maxdecel argument to 0.01 so the character controller slides on the ground, as if on ice. However, while you slide and press jump (letting go of the directional button), jumping slows you down and stops you, while in the air (much faster than even ground deceleration would). 2. With acceleration/deceleration included, shouldn't the character controller slide while you try to change directions? Right now the below code lets you change directions instantly in any other direction. Worse, you instantly go full velocity in the new direction, even if it took a second or two to get up to full speed the original direction. I may be doing something wrong but these seems like bugs. #include "Leadwerks.h" using namespace Leadwerks; Entity* player = NULL; int main(int argc, const char *argv[]) { Leadwerks::Window* window = Leadwerks::Window::Create(); Context* context = Context::Create(window); World* world = World::Create(); Camera* camera = Camera::Create(); camera->SetRotation(35, 0, 0); camera->Move(0, 0, -8); Light* light = DirectionalLight::Create(); light->SetRotation(35, 35, 0); //Create the ground Model* ground = Model::Box(10, 1, 10); ground->SetPosition(0, -0.5, 0); ground->SetColor(0.0, 1.0, 0.0); //Create a shape Shape* shape = Shape::Box(0, 0, 0, 0, 0, 0, 10, 1, 10); ground->SetShape(shape); shape->Release(); //Create a character player = Pivot::Create(); Entity* visiblecapsule = Model::Cylinder(16, player); visiblecapsule->SetScale(1, 2, 1); visiblecapsule->SetPosition(0, 1, 0); player->SetMass(1); player->SetPhysicsMode(Entity::CharacterPhysics); while(true) { if (window->Closed() || window->KeyDown(Key::Escape)) return false; Leadwerks::Time::Update(); float move = (window->KeyDown(Key::Up) - window->KeyDown(Key::Down)) * 4; float strafe = (window->KeyDown(Key::Right) - window->KeyDown(Key::Left)) * 4; float jump = window->KeyHit(Key::Space) * 10; player->SetInput(0, move, strafe, jump, false, 0.05, .01); world->Update(); world->Render(); context->Sync(); } return 0; } 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted February 28, 2019 Share Posted February 28, 2019 I have not forgotten this. I am working my way up the ladder in order of difficulty. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
gamecreator Posted February 28, 2019 Author Share Posted February 28, 2019 This is probably an easy one to fix: https://www.leadwerks.com/community/topic/17034-material-files-dont-show/ Also, these two are character controller related as well, if you want to tackle the same type of stuff together: https://www.leadwerks.com/community/topic/16198-character-controller-bugsproblems-in-beta/ https://www.leadwerks.com/community/topic/15933-character-controllers-jump-height-bugged/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.