Okay, so I have this code
var player : Transform;
function Update () {
if (Input.GetButtonDown ("Jump")) {
rigidbody.AddForce (transform.position - player.transform.position, ForceMode.Impulse);
}
}
This finds the direction between my player and the object this code is attached to, then adds force in that direction. The problem is that the amount of force applied varies depending on my distance from the gameobject w/ the script.
So my question is, can I apply x amount of force in y direction, instead of having the force and direction combined into one variable?