Im hopelessly not good at algebra and such. But im trying to learn. I want to learn and understand how to use it in game programming rather than modifying snippets or using classes that do it for me.
So what i want to start with is to click on location and have an object move there. This is what i am thinking (in pseudocode and in a 2D world).
vector2 mousePosition;
vector2 playerPosition;
vector2 direction = playerPosition - mousePosition;
direction.normalize; //ive learned that this should be done, and i understand what it means to normalise a vector, but i am not quite sure of what goes wrong if the vector is not normalised
//in the players update
if (player is not facing destinations direction)
{
player.transform.direction = Lerp towards direction;
}else if(player IS facing the destinations direction)
{
player.rigidbody.AddForce(vector.forward, 100f);
}
Am i thinking correctly?