playMaker

Author Topic: Touch Count with Create & Destroy Objects  (Read 4191 times)

TVGRAFX

  • Playmaker Newbie
  • *
  • Posts: 7
Touch Count with Create & Destroy Objects
« on: November 03, 2013, 12:55:11 PM »
After following the iOS touch count tutorial on the PlayMaker YouTube channel where some one touches the screen and the #1 appear through Set GUI text action. I'm trying to replace the GUI text with a Create Game Object action. And use the Create Game Object action for each touch count.

The problem that I can't figure out is how to destroy an object once a finger is released off of the screen. Thus making the hierarchy produce many clones over and over again. For example, 3 fingers down the 3 objects appear - lift one finger up 2 objects appear. The models are created to reflect the touch count - 3 touches = three cubes within the model.

If anybody has any suggestions or helpful hints please let me know.

Signed, Shake & Bake.

sharp1959

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Touch Count with Create & Destroy Objects
« Reply #1 on: November 03, 2013, 08:14:35 PM »
Hello TVGRAFX,

You usually make a prefab to start with and put inside your prefab folder in assests,
then when you touch the screen use the "create object" action and under the "create object" action you need to store your object you created in a game object variable you make , then when you lift your finger you destroy that object...that you saved...

hope that make sense... ;)

TVGRAFX

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Touch Count with Create & Destroy Objects
« Reply #2 on: November 09, 2013, 12:42:34 AM »
Looks like I have it working but I'm only able to touch or use it one time then the prefab can not be created again.

It's a head scratcher for sure.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Touch Count with Create & Destroy Objects
« Reply #3 on: November 11, 2013, 01:37:51 AM »
Hi,

 to do this, you MUST save the fingerID to track what finger what released, I think this is what you miss.

 so in your prefab, you have to store the fingerID that actually instantiated it and you only look for the fingerID event in there.

bye,

 Jean