# Simple character movement in 3d environment

This topic is 2151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm currently trying to implement some basic character movement for a first person game I'm working on, but I've run into some problems.

Let's say there's an outside force that applies a velocity of Vector(500,60,0) to my character. For the sake of this example, let's say that force is constant and doesn't decrease.

Now the player starts moving in a random direction, like Vector(0.827846,0.560955,0).

How can I determine how much more the player can accelerate in that direction without going over the bounds of his max movement speed?

I basically need to retrieve the speed of the outside force in the player's movement direction.

Any suggestions?

How's this usually handled in other games?

##### Share on other sites

Why do you need to determine that? I would think you just compute the sum of all forces on the character and integrate. If you want to impose a maximum movement speed, I can think of several ways to do it:

1) limit the velocity vector's magnitude explicitly,

2) introduce drag,

3) make the force applied by the character's locomotion system depend on how fast he's going,

4) Lorenz contraction (this is mostly a joke).

##### Share on other sites

I basically need to retrieve the speed of the outside force in the player's movement direction.

Normalize vector of player direction, and make dot product of normalized direction and the velocity vector arising from outside force.

##### Share on other sites

Doesn't "player's max movement speed" actually refer to the speed/velocity that is generated by the player's own, internal forces? I've never heard of limiting external forces. You'll basically end up limitng things like gravity - I don't think that's your intent.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 11
• 9
• 24
• 48