What I am trying to do is run a character from point A to point B along a sloped mesh. The collision response animator does its job and checks collision when the model is stationary. When I move my model, it 'floats' slowly down. So running up the slope, no big deal. Running down the mesh is floating. The game logic is as follows:
vector Hero;
vector position = model->getPosition //this gets the current position of model
if(moveLeft)
position.X -=1;
if(moveRight)
position.X +=1;
Hero = Position;
model->setPosition(Hero);
Why is my model Floating???
Problems with CollisionResponseAnimator and movement
-
- Posts: 39
- Joined: Wed Oct 04, 2006 8:00 am
Do you mean that as you run uphill everything works fine and the hero stays on the ground and climbs but when you go downhill he stays at the same Y value so he just sort of walks into the air?
If so, here's a -very- quick somewhat-fix that you could mess with. Somewhere in your main game loop put:
He'll always fall until he hits the ground, at which point the collision detection will take over and hold him there. Of course this is pretty messy logic, but maybe you could work with it And of course, if you're standing still on a steep slope he'll slowly slide down, but that effect may be desirable.
If so, here's a -very- quick somewhat-fix that you could mess with. Somewhere in your main game loop put:
Code: Select all
vector3df position = model->getPosition();
position.Y -= 2;
model->setPosition(position);