Skip to content
Snippets Groups Projects
Commit d62c948f authored by fdavin's avatar fdavin
Browse files

feat: bow damage

parent 48922b99
Branches
Tags
No related merge requests found
......@@ -17215,6 +17215,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
arrowPrefab: {fileID: 5421094194298167727, guid: d30cbd661c68d9a4eae6f5ca6069e3ee, type: 3}
arrowSpawn: {fileID: 703166367}
damage: 100
Reloading: 0
--- !u!1001 &1443165390
PrefabInstance:
......
......@@ -21,6 +21,9 @@ public class Arrow : MonoBehaviour
transform.parent = null;
}
public void setDamage(int damage){
this.damage = damage;
}
void OnTriggerEnter(Collider other){
if (didHit) return;
if (other.gameObject.tag == "Player") return;
......
......@@ -9,7 +9,7 @@ public class Bow : MonoBehaviour
public Arrow arrowPrefab;
public Transform arrowSpawn;
private Arrow arrow;
public int damage;
public bool Reloading;
public void Reload()
......@@ -30,6 +30,7 @@ public class Bow : MonoBehaviour
{
if (Reloading || arrow==null) return;
var force = arrowSpawn.TransformDirection(Vector3.forward * power);
arrow.setDamage(damage);
arrow.Fly(force);
arrow = null;
Reload();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment