Something went wrong when working with timer, spawn and touch.
greedydady
Member Posts: 35
Hi everyone, thanks for helping so far and i have learnt a lot in this community.
Recently i am working on a function.The core part is, an actor will spawn another actor after a time whenever received one touch. My working way is quite simple, i put a rule in actorA. which is whenever received a touch pressed, and than inside a timer set to after 2 second with run to completion tick, Spawn actor B.
I thought it is quite simple, but it turns out some problem. When i am holding my mouse touch on the actorA, it never spawn B. until i release the mouse button than after 2sec it spawn.
Am i understand the " touch press" rule wrong or the" run to completion " wrong?. All i want is just whenever it received one touch (no matter the player is holding the touch or released immediatly), it spawn B after 2 sec. Anybody know which part went wrong? Thanks!
Recently i am working on a function.The core part is, an actor will spawn another actor after a time whenever received one touch. My working way is quite simple, i put a rule in actorA. which is whenever received a touch pressed, and than inside a timer set to after 2 second with run to completion tick, Spawn actor B.
I thought it is quite simple, but it turns out some problem. When i am holding my mouse touch on the actorA, it never spawn B. until i release the mouse button than after 2sec it spawn.
Am i understand the " touch press" rule wrong or the" run to completion " wrong?. All i want is just whenever it received one touch (no matter the player is holding the touch or released immediatly), it spawn B after 2 sec. Anybody know which part went wrong? Thanks!
Comments
Two questions. Are actor A and actor B the same image and color & are you telling Actor B Where to spawn? I ask because if you are telling id how you have it written then it is spawning actor B but actor B is spawning directly onto of actor A.
Hi, @KillerPenguinStudios, so just to get this clear: Actor B is doing what, directly onto actor A? ;-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I am speechless as to how that gotten written out. Guess we know where my sub conscience is at. Editing now! This made me spit my water out of my mouth! LOL! #-o
Sorry about my poor English. I am trying to explain it more clearly.
The are completly different actor, image and color.
Yes, i told B where to spawn by table.
And i mentioned wrong in my question. The problem is, when i keep taping(like very fast) the Actor A, actor B never spawn. Until i stop tapping it and than after 2 sec B spawn. Not holding the touch on actor A. Sorry for my poor english again.
For further details abt my function, here is how they work with each other:
They are interacting each other through a table with 3 rows. Each of the 3 rows contain 1 column for boolean and 2 column for X and Y postion.
The rule in A is set to whenever touch pressed, after 2 sec change the table value(the 3 rows boolean) into true, so that it can link up the attribute in B. B contrained its boolean with the boolean in that table so everytime when 3 rows became true, B1,B2,B3 spawn. Each B will than applied an ID to itself base on the position XY i set in table. After, whenever Bs destroyed, have a rule change that boolean value in table to false. The ID will tell the B which row in table to set back to false.
In conclusion: click on A>2sec> turn all rows to true> B1,2,3 spawn> Whenever i destroyed Bs(says B1 and B3)> row 1 and 3 became false> click on A> respawn B1 and B3 but not B2. A loop.
Thanks for helping man.