I love playmaker and the tutorials helped a lot. Where I really struggle is when trying to use the input events.
I'm trying to port to Playmaker a "flight control" game - where you select a plane and then draw a flight path for the plane to follow.
I don't want to use Mouse Drag since that will be hard to port to touch. The existing code for the game that I'm trying to port (C#) makes this very easy:
void Update ()
{
//if we are controlling the plane and the game is not over
if (controlPlane && !player.gameover)
{
//if mouse button is up
if (Input.GetMouseButtonUp(0))
{
//set controlPlane to false
controlPlane = false;
}
//get mouse position
inputPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
// do stuff
}
}
//if click or touch the plane
void OnMouseDown()
{
// Do some stuff...details not important
//set controlPlane to true
controlPlane = true;
}
}
Very simply, in the mouse down function they set a boolean to true.
Then, in the update function they simply look for this boolean to be true and if it is, simply grab the current mouse position.
In playmaker, I can create a state with a global transition for MOUSE DOWN and set the boolean to true.
But then I'm lost...where would I put the corresponding code of the update function?
I've tried all different kinds of things and can't crack which should be a simple port. I'd be happy to hear any and all suggestions - or even otherwise of implementing a "click and draw" implementation in Playmaker.
After 4 days of struggling I figure it's time to turn to the experts!
Thanks in advance
Chris