playMaker

Author Topic: How do I set a random number for a value in itween for example[SOLVED]  (Read 3407 times)

artfish

  • Playmaker Newbie
  • *
  • Posts: 5
Hello everyone! Just getting started with Unity and Playmaker here. Coming from one of those "Other" engines. I'm getting up to speed watching all the tutorials I can and scouring google and such.

So I've been searching for a while now, and I'm not having much luck.

Here's one of the first things I'm trying to figure out. Using a random number for a value.

Ok, for example, I have a FSM on a plane that has a texture of a cloud mapped on it. I've added an itween move add.I want this cloud to move to it's destination at a random speed.

How would I type this into the speed box? Or, is this even how I should be doing it?
Basically trying to do speed=random( .1,.8 )
Thanks! ;)
« Last Edit: September 17, 2013, 11:59:06 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do I set a random number for a value in itween for example
« Reply #1 on: September 13, 2013, 02:58:22 AM »
Hi,

 create a float variable on that fsm, and name it "speed" and set its value to 1.

in the itween action, instead of manually inputing the speed, select that variable instead.

and now, just before the itween action use an action called "Random Float" and define your range there. your speed will then be randomized, and used within the itween action.

 Does that make sense?

bye,

 Jean

artfish

  • Playmaker Newbie
  • *
  • Posts: 5
Re: How do I set a random number for a value in itween for example
« Reply #2 on: September 17, 2013, 11:15:59 AM »
@jeanfabre Thanks!