i am trying to instantiate a prefab in front of my moving character but its not working. Tried my hands with everything av seen online still no result.This is my current code
var target:Transform;
var obstacle:GameObject;
function Start () {
}
function Update () {
}
function OnTriggerEnter(col:Collider) {
if (col.gameObject.tag=="fish"){
Instantiate(obstacle,target.transform.position + target.transform.forward*10,target.rotation);
}
}