How to make intersect script work
Long story short, I have a bullet prefab which instantiates on purpose inside the body of my player and enemies. The problem is they detect this as an impact and lose health every time they fire a bullet. I was advised to add an intersect script which would mitigate this issue by only activating the damage only after a quarter of a second. But I can’t get this script to work:
using UnityEngine;
using System.Collections;
public class BulletIntersect : MonoBehaviour {
// Use this for initialization
void Start () {
Bullet = this.gameObject;
}
// Update is called once per frame
void Update () {
time_bullet = Time.deltaTime;
//get array with all enemies
GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemies");
bool intersects_bool = false;
foreach(GameObject Enemy in enemies){
if(Bullet.Intersects(Enemy)){
intersects_bool = true;
}
}
if(time_bullet<Time.deltaTime+0.25f && intersects_bool==true)
}
}
I am getting the following errors: Unexpected symbol `}’ for line 27 and Parsing Error for line 30. Please help me out with this? How do I make it work?