Quantcast
Channel: Latest Questions by FKKrjakonzo
Viewing all articles
Browse latest Browse all 8

Reflecting projectiles back

$
0
0
Could someone help me, i want to create script which makes - wall reflect projectiles back to position i shoot them. So basicaly i want to projectiles hit me back when i shoot on wall. Here is script which shoot projectiles var projectile : Rigidbody; var speed = 20; var time=2.0; function Update () { time = time + Time.deltaTime; if (Input.GetMouseButtonUp(0)&&time>=2.0) { time=0.0; clone = Instantiate(projectile, transform.position, transform.rotation); clone.velocity = transform.TransformDirection( Vector3 (0,0, speed)); Destroy (clone.gameObject, 3); }} and i want to add something to walls to be immune to this projectiles and reflect them back Sorry for bad english

Viewing all articles
Browse latest Browse all 8

Trending Articles



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