#Ok Im not your teacher but i wouldnt
1 messages · Page 1 of 1 (latest)
its currently 1am, would it be alright for you to just tell me what to add and where, just as i still dont fully understand the concept and therefore id like to see how it should look so i know how to do it for next time
or would possibly have time to explain it tommorow so i can figure out what to add and where
Just this once.
void OnEnable()
{
Invoke("disableHazard", aliveTime);
}
void disableHazard()
{
gameObject.SetActive(false);
}
Thats just about it. I moved it to OnEnable instead of Start, since you will be re-using objects. This means the second time the object is used it wouldnt get Start at all.
Oh that makes sense, but annoyingly i still recieve the same error in the spawner script
Hey you already knew how to deactivate it!
// if we couldn't find one, log error
if (!pooledObj)
{
CreateInitialPool(); //Expand the pool by 10 elements.
return GetPooledHazard();
}
This is one way of doing it
Usually this is how pools work, when its full, just add more elements.
awesome ill try that \
its been 3 weeks since i touched it last given other assignments
awesome btw i fixed the spawner code and it functions now but the problem is the timer woulnt work properly as it would turn them of at random times, now i have hooked it up to a trigger system with boundaries but it goes right through