I am in need of some help.
I have this script that destroys objects when the objects reach the end of the line.
I would like to change it so that when the object reaches the end, it first becomes unclickable, stops moving for 1 second, and then gets destroyed. This script would be for my very first game, still learning.
void Update()
{
thisTransform.Translate( Vector3.forward * gameController.moveSpeed * Time.deltaTime, Space.Self);
if ( thisTransform.position.z > gameController.laneLength )
{
if ( hurtTarget == false ) gameController.ChangeLives(-1);
gameController.objectsLeft–;
gameController.UpdateProgress();
Destroy(gameObject);
}
}