Hi,
I'm making a game and I'm of course in need of a character, and thusly I've implemented one with a rectangular body. I have, however, run into some problems with the character movement. The problems can be divided into two parts:
1) I'm having problem with the body moving convincingly. I'm using applyForce(...) to move the character, but it's hard to tweak the force so that the character both can start from standing still, i.e. overcome the friction, and not accelerate to too high speed just from running. I've experimented with applying forces that are not parallell with the floor surface, which should mimic reality a bit more, but the results is still not that great.
2) When the character os moving on top of a non-static object the object tends to follow the character. Imaging that you walk on a carpet, but instead of walk over the carpet the carpet starts moving along with you across the floor. I think this problem arises from me applying a force on the character, but no counter force on the floor surface. With this in mind I figured that I just needed to apply the negative of the characters force on the floor's connection point with the character. This however created very weird result such as the floor object gaining way to much angular velocity and spinning across the world.
The main issue is the second one, and if someone has encountered this problem before and solved it, i'd very much like to be advised. The first I imaging i can figure out myself given enough time, but I would very much like to hear from people who has had problems with this in the past and overcome them.
I'm not going to post any code unless asked to, partly because this post is grand as it is, but mostly because i think I covered the specifics of the issue in the text.
/w
I'm making a game and I'm of course in need of a character, and thusly I've implemented one with a rectangular body. I have, however, run into some problems with the character movement. The problems can be divided into two parts:
1) I'm having problem with the body moving convincingly. I'm using applyForce(...) to move the character, but it's hard to tweak the force so that the character both can start from standing still, i.e. overcome the friction, and not accelerate to too high speed just from running. I've experimented with applying forces that are not parallell with the floor surface, which should mimic reality a bit more, but the results is still not that great.
2) When the character os moving on top of a non-static object the object tends to follow the character. Imaging that you walk on a carpet, but instead of walk over the carpet the carpet starts moving along with you across the floor. I think this problem arises from me applying a force on the character, but no counter force on the floor surface. With this in mind I figured that I just needed to apply the negative of the characters force on the floor's connection point with the character. This however created very weird result such as the floor object gaining way to much angular velocity and spinning across the world.
The main issue is the second one, and if someone has encountered this problem before and solved it, i'd very much like to be advised. The first I imaging i can figure out myself given enough time, but I would very much like to hear from people who has had problems with this in the past and overcome them.
I'm not going to post any code unless asked to, partly because this post is grand as it is, but mostly because i think I covered the specifics of the issue in the text.
/w