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
↧