Need help with pickup code
I'm trying to write a rule which has to have two conditions met to perform a behavior. The problem is that the behavior is actioned when only one condition is met.
In the game I have a character that can pick up objects and move around with them. I want to make it so that he can only pick up one object at a time, and ignore the other objects.
I have created a Game level attribute called 'Captured'. The rule says that when both the player collides with the actor and 'Captured' is 'False', the object is captured and the 'Captured' attribute is switched to 'True'. This works fine, but when the character goes over to a second object carrying the first object it's also picked it up, even though the 'Captured' attribute should now be set to 'True'.
Any advice would be greatly appreciated.
Comments
Are you sure your Captured Attribute is updating correctly?
You should display it's value on screen while your playing the game to be sure. Use an actor and a display text behavior and watch if/when it changes.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thank you jamie_c. That made things much clearer. I have now solved the issue!!
Glad to hear it!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page