change speed again after collision prefab has been destroyed
Hey !
I have a spawnmanager with game objects / prefabs. They move on z axis forward.
gameObject movement set speed to be '0' when collided with instantiated prefab "barrier" This i got working.
void OnTriggerEnter(Collider other)
{
if (other.tag == "barrier")
{
speed = 0;
Debug.Log("BARRIER HIT");
}
}
The "barrier" prefab is being destroyed after 10 seconds after instantiate. That also works good.
BUT : gameObject variable 'speed' need to change back again, to base value , after the prefab 'barrier' has been destroyed.
How could i approach this ?
Your answer
Follow this Question
Related Questions
How to store a GameObject in an AssetBundle and this on harddisk/webserver via editor script? 1 Answer
Prefab turned invisible after running the game *See image* 0 Answers
Arrows fire in reverse. 1 Answer
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption. 0 Answers