Hi Everybody!!
I have the next problem:
![alt text][1]
[1]: /storage/temp/50150-sin-titulo.png
I have two characters on a object which rotates around "target". Everything it's fine.
The problem is...
When the Character B throw a prefab ball to the character A the object never reach "target1" it lost in the infinite space...
This is the code that I actually using for it...
private Animator anim;
public Transform target;
public Transform outzone;
public float velocidad;
public float timeDelay = 3.0f;
private float timestamp;
public Rigidbody object;
void Start () {
anim = this.GetComponent ();
timestamp = 6f;
}
void Update () {
anim.SetTrigger ("Throw");
timestamp += timeDelay;
}
}
public void Throw (){
Rigidbody shootInstantiate;
shootInstantiate = Instantiate (object, outzone.position, outzone.rotation) as Rigidbody;
disparosInstantiate.transform.LookAt (target);
disparosInstantiate.AddForce (target.position * speed);
disparosInstantiate.transform.parent = gameObject.transform;
Character A and B are "children" of the big object...
Please help!!
↧