Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: will_brett on February 06, 2013, 06:54:12 AM
-
Hey everyone.
i have made a simple blink animation using TK2d and now I want to make my character blink occasionally and randomly. How would I go about doing this? I suppose it doesn't have to be random, just not seem like the blink is on a constant loop where you can predict when it will blink if that makes sense.
thank you
WB
-
...BUMP...
-
You can make random delay with two simple actions:
With <Random Float> you generate specified random number and save it to variable.
Next you use that variable in delay field of <Wait> action. You loop states and it's done.
(animation must be set to play Once)
-
Thank you so much.
I will get on this right now.
All the best
Wb
-
I can't seem to get that to work.
What i did was have randomfloat under start that would generate a number between 5-30 and store result as a float names "Random_Number". I then created a new state with 'Wait' which looked for Random_Number, i left finished event blank and real time unchecked. Next I had a new state with TK2D Play Animation. Game object use Owner and clip name as "idle".
Where have I gone wrong? Im sure its something obvious. I also made sure animation is set to play once.
Thanks
-
I have also tried first state Random_float between 5-30 then having a wait state that uses Random_number for time and then loops back into the "Random_float" state
This also doesn't seem to do anything.
-
Oh it simply don't work now because in <Wait> you should fill Event field with relevant event. In this case shown above - named "Wait". Then it will proceed.
ps: In this "Random_Float" state, action that plays blink animation should fire finishing event as well.
-
Im not 100% clear what you mean. Do you mean fill the finish event with a "wait" event or that I have gotten the events set up wrong?
Thanks again
-
Take a look at this example (attachment below). After filling <Play Animation>'s target object and animation name fields then it should work and self-explain this process a bit.
-
Thank you that has made things much clearer and I can see the issue now.
In your example you have used a Play animation action, but I am using TK 2d for the animations so this will not work and if i use the TK 2D play animation action it doesn't have a finish event option
-
SOLVED!
All I needed to do was add TK 2d play animation with Events and not TK 2d play animation
Thank you for your help much appreciated