hi guys
i am working on 2D ranged character attack, i can instantiate a prefab but its origin point is center of the player. i want to prefab origin in front of the character rather than inside of him
here are my two codes
if (Input.GetKeyDown("f")) {
attackRange();
}
function attackRange () {
Instantiate(rangeattackPrefab, this.transform.position,this.transform.rotation);
Playerattack.js
var fireAttackSpeed : float = 1.0;
function Update () {
// prefab moves right side
this.transform.Translate(Vector3.right * fireAttackSpeed);
}