Quantcast
Channel: Latest Questions by Guille_b
Viewing all articles
Browse latest Browse all 18

Problem with instantiate rotation

$
0
0
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!!

Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>