Quantcast
Channel: Questions in topic: "rope"
Viewing all articles
Browse latest Browse all 194

how to shoot a rope

$
0
0
I attach the Cannon.cs to the cannon to fire the rope(Link joint) with mouse aim.But When I shoot the rope,the rope is invisible,and the speed is not fast,why? public void Fire(Vector3 pos) { //point to target Vector3 fireDir = pos -transform.position; float angle = Mathf.Atan2(fireDir.y,fireDir.x)*Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(new Vector3(0,0,angle)); //spawn the rope GameObject bullet = Instantiate(bullets[currentLevel-1],new Vector3(transform.position.x,transform.position.y,0),Quaternion.identity) as GameObject; bullet.transform.rotation = transform.rotation; Bullet bul = bullet.GetComponent(); bul.moveDir = new Vector3(fireDir.x,fireDir.y,0); bul.level = currentLevel; }

Viewing all articles
Browse latest Browse all 194

Trending Articles



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