# Creating different controls for character/vechile movements

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

## Recommended Posts

So i am starting to get abit better at programming and would like to start a game, basically i want to know what is the best way to create a player / vechile type movements, i am finding it hard to understand velocitys and vectors and when to use them , i know if its a third person type game that the camera follows the player or vechile but the vechile camera will be different to the player one as when you yaw and pitch the mouse, you can look around the target, but if your controling the player you need to yaw the camera with the player, its hard to explain but how would you make mechanics that would switch between the 2 camera modes and also how to make decent player movements,thanks if you can help, sorry i sound confussed on the matter.

I am looking at this

because if i was to add a vechile for the player, it would need a free camera where it looks around the target, so you can look around while driving

Edited by Anddos

##### Share on other sites

You may have to study some basic physics to wrap your head around vectors before you can create a decent driving simulation... or really, almost anything.

They're pretty important :)

If there's something about them you don't understand, I can try to help explain it.

Switching the camera positions and behaviors, you mean to be able to toggle between them?  You could just use a bool to control the state and behavior of the camera, and assign some kind of control, maybe tab, to switch between them.

##### Share on other sites

i am finding it hard to understand velocitys and vectors and when to use them

You are  building a 3D game.

The mathematics of 3D environments is called "linear algebra".

One option is to teach yourself.  Be prepared for a lot of learning, since it has a lot of prerequisite knowledge.

Usually the beginnings of linear algebra, matrix math and vectors, is taught near the end of secondary education, your senior or junior year of school. The math topic doesn't usually start in earnest until the second or third year of college studies.

If you do not have the necessary math skills you will fail horribly at making a 3D game engine.  You can gain those through self-study or through formal education, but you absolutely must have them to build a 3D engine.

If instead you are using an existing game engine like Unity or Unreal or C4 or something, you can rely on it to do most of the work.  Not knowing the math will severely limit your ability to do cool things, but most of the simple things you should be able to reason through without the math skills.

##### Share on other sites

Although I work with 2D games, as I'm relatively new to games development, I recently set up this kind of system using SFML. Essentially, I built a Control class which had several different control methods in it (Standard 8D movement, sin/cos based rotational movement(cars) etc.) and I called them based on a flag specified earlier, which changed as the player state (on-foot, car, water etc.) changed.

I understand the process is likely to be hugely more complex than this in a 3D game, but could the fundamental idea behind it work?

I'd also like to know, as I intend to move to 3D games soon, and hope some of the fundamentals translate across.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 10
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633718
• Total Posts
3013518
×