Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: solideuk on August 20, 2015, 05:32:26 PM
-
Hi All,
I would be grateful for some advice. What would be the best approach if I would like a trigger to determine whether the player is holding an item?
For example:
If player enters a trigger and is holding an apple, the box should turn green.
If player enters a trigger and is holding an orange, the box should turn orange.
What is the best way to do this?
Should I place a 'tag' on the objects and then use OnStayTrigger to find if a player is holding a particular object?
Many thanks in advance for any guidance
-
Hi,
It depends on how many items.
if just a few you can make some bools with their name and check if those bools are set to true.
If you get more items you could use arraymaker (https://hutonggames.fogbugz.com/default.asp?W715) and add the items to it and then you can check if the list contains your items.
Here (http://hutonggames.com/playmakerforum/index.php?topic=9800.0) are some tutorial videos for array maker
-
Thanks djaydino
I've taken this approach, I've used the Get Child method to get the tag name then used the boolean parameter to see if they are true/present