How do I go about targeting an add force script.
I am trying to kick a soccer ball how do I implement aming into a certain direction.
What sort of scriprt refrences to I have to look for.
Thanks for your help in advance!
How do I go about targeting an add force script.
I am trying to kick a soccer ball how do I implement aming into a certain direction.
What sort of scriprt refrences to I have to look for.
Thanks for your help in advance!
You can do like:
warning code can have compailing errors!
var thefoot : GameObject;
var adjustforce = 10;
private var theforce = 0;
private var dir : Vector3;
function FixedUpdate () {
theforce = thefoot.rigidbody.velocity * adjustforce;
dir = thefoot.transform.TransformDirection (Vector3.up); //blue arrow
rigidbody.AddForce (dir * theforce);
}