george68 Posted May 30, 2021 Share Posted May 30, 2021 Hi, I've set up a character controller as follows: pControler = Pivot::Create(); pControler->SetPhysicsMode(Entity::CharacterPhysics); pControler->SetMass(1.0); pControler->SetPosition(pEntity->GetPosition(true)); pEntity->SetParent(pControler, true); pEntity->SetPosition(0.0, getHeight(), 0.0); pEntity->SetMass(0.0); and the update world function is: walk = (window->KeyDown(Key::Up) - window->KeyDown(Key::Down)) * 7.0; if (window->KeyDown(Key::Shift)) { strafe = (window->KeyDown(Key::Right) - window->KeyDown(Key::Left)) * 2.5; } else { if (window->KeyDown(Key::Right)) angle += 2.0; if (window->KeyDown(Key::Left)) angle -= 2.0; } jump = window->KeyHit(Key::Control) * 10.0; pControler->SetInput(angle, walk, strafe, jump); Everything works fine, unless I change I change the value from 10.0 to 20.0 in the following line: jump = window->KeyHit(Key::Control) * 20.0; Please watch the following video: https://youtu.be/-ufOAnsDqSs Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted May 30, 2021 Share Posted May 30, 2021 Has pEntity got a collision shape? It looks like the player collides with something invisible sometimes. Turn on DebugPhysics so you can see all the collision shapes. 2 Quote Link to comment Share on other sites More sharing options...
george68 Posted May 30, 2021 Author Share Posted May 30, 2021 Quote Has pEntity got a collision shape? Yes, it has. I set up a physics shape to NULL: pEntity->SetShape(NULL); and it works OK. Thank you! 1 1 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.