- Home /
On trigger Activate collect item type of objective then play a cutscene after all are collected at a trigger too.
I really need help at this, so basically I am making a horror game. I need help on some scripting and make things work out, Im kinda new to unity, still learning, So yea I need some guide on how to do this, When you enter a trigger you will get an objective to collect all those materials and go to a certain place then play a cutscene, obviously it has too have that text saying "u dont have materials" when you enter the trigger without the materials so yea its an objective. More like I want to make an objective where you collect necessary materials then play a cutscene "IF" you have collect it all and say a text if you are still missing a material, Help would be very much appreciated
P.S English is not my thing.
Why don't you post what code you have so far? $$anonymous$$ost people on the site don't like writing code FOR you, but do like to help.
No I just basically need some logic on how to do this, im not asking for a code.
Answer by goutham12 · Nov 01, 2017 at 06:05 AM
Make all your Objectives With same Tag (like material). whenever you collected one objective make a function like
Bool IsAllObjectivesCleared(){
GameObject[] _objectives = GameObject.FindGameObjectsWithTag("material");
if(_objectives .Length > 0)
return false;
else
return true; }
form this function you can tell that whether all objectives or cleared or not.