Alright so im at the end of my argon assault and all thats left is making my boss. I wanted to try something and make it so that while you fighting/chasing the boss he lays down mines as u chase them ( mines just being spheres that i painted) now i have two ways of doing this. I can either make a regular timeline of him and then make a Time line of the mines that will be timed so it seems like hes spawning them behind him while you chase. OR i could make it so that these mines spawn at his current location every few seconds (every 3 seconds or something) but the problem with that is im not sure what code words and such i need to use. I feel like ive done something like this before using instantiate but i cant remember. help would be appreciated
…
public class CreateMines : MonoBehaviour
{
public GameObject ProjectilePrefab;
public float spawnTime = 1f;
private void spawnOnBoss()
{
GameObject Mine = Instantiate(ProjectilePrefab) as GameObject;
Mine.transform.position = new Vector3(gameObject.position);
}
…
This was as far as my mind let me go i didnt know what to do after this. i was trying to put the mines new position on the ship but it doesnt look like you can do it like this with vector3s
so i put this code on my boss and it looks like the first mine drops at its current position and then the rest of the mines drop on the last mines position instead of where the boss is.
There seems to be a slight problem. So i put a code in my mines Destroy(gameObject, 1.5f); so that they are gone after a short time but my very first mine just comes back.
so i looked into it and it looks like there are mines spawning on the boss like i want it to and theres also mines spawning at the first mines location.
Edit: i went in and out of my level and it stopped doing that. i just needed to refresh the level it looked like lol thanks again. hope u get to try my game. ill be mostly finished with it by tuesday or so if i decide to make a home and end screen.