Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: soccergames on September 06, 2017, 03:43:58 PM

Title: If x Points achieved you can collide with object
Post by: soccergames on September 06, 2017, 03:43:58 PM
I'm new to playmaker. I have done the point system for my game but now I'm trying to do end of level which is once you have x points you can go to door which should check if you have x amount then proceed to next level.

Right now I've been trying to do INT compare for the door to see if point is greater than X then let user collide with it.. but its not working out.

Any tips?
Title: Re: If x Points achieved you can collide with object
Post by: Deek on September 07, 2017, 03:45:20 PM
The Quick Way
Set your Int Compare action to run every frame, but that's not very efficient.

The Proper Way
Whenever you get points you also send a global event to the state with the Int Compare action.

At the bottom of the PlayMaker Editor you also have the option "Debug" (above "Hints [F1]"), which shows you the runtime value of your int under the variable so you can check if it actually compares the right value.
If it stays 0 you likely need to make it global (right-click on it under the 'Variables' tab and make it a global variable), also make sure that everywhere you've used that variable to set it to the global variable.
Title: Re: If x Points achieved you can collide with object
Post by: djaydino on September 07, 2017, 08:14:06 PM
Hi,
Here is a video about global events/transitions that can be useful :