A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by andylhansen » Sat Jun 18, 2011 6:49 pm
So I've been messing around with the character controller provided in the JointsLibrary. It works pretty good. I've run into this problem though, where if I move my character up next to a dynamic body (a cube) and stop, it will slowly float up to the height of the top of the cube. This occurs when I push the cube against a static wall and then stop. Also when I'm pushing the cube, my character controller gradually rises up in the air. When I stop, the controller falls back down. Is there a way I can get my controller to be able to push stuff around without "floating" up on them weirdly.
-
andylhansen
-
- Posts: 21
- Joined: Sat Jun 04, 2011 6:32 am
by JoeJ » Sun Jun 19, 2011 6:45 am
I've never used the character controller, but it behaves like it should from what you're writing.
The contruller uses a capsule shape? So when the radius of the bottom halfsphere is greater than the box height, it should climb up to enable things like walking up stairs without jumping.
So you could either scale the boxes up, or the radius down. If radius gets too small (you can get too close to walls), you could replace the capsule with a charmfered cylinder. I hope it is that easy

-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
by andylhansen » Sun Jun 19, 2011 10:34 am
Thanks for the reply!
I've actually been using a regular cylinder, since that is what the tutorial code uses for it. I tried your suggestion of lowering the radius. It still has the same behavior. I can push the boxes around, but my player slowly rises up in the air. If I push the box against a wall and stop, my player slowly floats up the side of the box. It's really weird that it is climbing even though I'm not moving.
-
andylhansen
-
- Posts: 21
- Joined: Sat Jun 04, 2011 6:32 am
by JoeJ » Sun Jun 19, 2011 11:46 am
Ok, but maybe i'm not completely wrong. Looking at the CustomPlayerController sources from joint lib (there's no "Character"Controller), i saw it internally generates 3 different convex hulls to sensor the world.
Maybe the boxes are treated as stairs. The maxStairStepFactor is given at the constructor, did you tried a very low value for that?
If you ar behind a wrapper, which hides that (and renames to CharacterController), lowering cylinder hight would have the same effect.
The code uses it to calculate stair height by multiplying the player height, which ist measured from your cylinder:
// set stairs step high as a percent of the player high
m_stairHeight = m_playerHeight * maxStairStepFactor;
-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
by andylhansen » Sun Jun 19, 2011 12:00 pm
The CustomPlayerController is what I'm using. I tried decreasing the stair step factor to a very small number, but the problems still persisted. Except this time my player would try to climb the box and get stuck in place. If I set the factor to 0, all the problems go away, except that I cannot climb any ramps or stairs. Perhaps the CustomPlayerController isn't really meant to interact with dynamic bodies.
-
andylhansen
-
- Posts: 21
- Joined: Sat Jun 04, 2011 6:32 am
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests