Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: dubnug on February 01, 2013, 04:26:20 PM

Title: Can Playmaker handle multiple object animations on GUIslider [SOLVED]
Post by: dubnug on February 01, 2013, 04:26:20 PM
I'm about to purchase Playmaker, but I mainly need it to be able to control multiple object animations on one GUI slider.

i.e.
Cube1 has an animation that scales it to (10) over 10 seconds
Sphere1 has an animation that scales it to (5) over 10 seconds

Both animations are controlled on one GUI horizontal slider, simultaneously.

Their animations are not connected, they are attached to different GameObjects.

Would this be possible? I'm eager to purchase it now, but want to make sure it could do this first.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: Lane on February 01, 2013, 04:46:48 PM
Yes.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: dubnug on February 01, 2013, 06:46:46 PM
Thanks for the reply, simple and elegant. hah is there any chance anyone could supply me with some tips/documentation/tutorials on running multiple animations thru the slider? I've seen the Playmaker tutorial where one object's animation is controlled on the slider, but it doesn't mention doing more than one.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: Lane on February 01, 2013, 07:51:31 PM
You would basically just use that tutorial you saw and have it do two things instead of one.

You can stack as many actions as you want into a state. It's easy to understand once you see how it works and play around with it.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: dubnug on February 02, 2013, 12:28:44 AM
awesome, thanks for your help.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: dubnug on February 02, 2013, 03:32:51 AM
Sorry for the double post..

I just purchased Playmaker and it looks great, but I'm not yet sure how to have multiple animations guided by the GUI slider. I'll keep messing around with it but I have a short deadline, so any help would be greatly appreciated!

I first messed around with having multiple Set Scales in the same state as the GUI slider. But since there can only be one float object in the GUI slider, each object just goes at the same scale rate. So I tried with two GUI slider actions with a separate float for each of the objects' scale (all in the same state), but that just created two GUI sliders on top of each other.

I was trying to have a "parent" GUI slider without any other actions in the state, then attaching separate states to that with a "Mouse Drag" transition. Didn't seem to work, but I could (likely) be missing something.

I can't find any documentation or tutorials on the exact subject unfortunately. It'd be ridiculously awesome if someone could step me through it even if it's super basic with cubes and stuff, but again, any help is welcome  :)
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: Lane on February 02, 2013, 12:52:22 PM
You have to do a math operation that interrupts the slider float that is affecting the object scale.

So basically save the slider float into a variable, then instead of reading that directly have an empty object do a float multiply and save the result, then have the cube read that as the set scale. Then do a different math operation and save it for the scale you want the sphere to follow.

It's basically just Slider Float - saved as base value - do some math - save as new value - object reads new value. Duplicate for different objects, scales, float variables.


Probably not as efficient as it could be, but I suck at optimizing the math stuff.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: jeanfabre on February 02, 2013, 03:10:23 PM
Hi,

 I think you only miss the fact that you can get a variable from a fsm using the the action "get fsm float".

 in our case, any fsm that wants to get the slider value and do what ever it wants with simply need to us this get fsm float and reference the variable used in the "gui slider" action.

 I have attached a working example so that you understand how it works.

If you have more questions, don't hesitate.

bye,

 Jean
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: Lane on February 02, 2013, 05:15:34 PM
Here's an extension of that example. The cubes are just using the same number from the slider and multiplying it differently to their own scale.
Title: Re: Quick question: Can Playmaker handle multiple object animations on one GUIslider
Post by: dubnug on February 03, 2013, 02:37:59 AM
you guys have been a massive help. Jean, I've seen your posts on other topics (I stumbled upon something semi-familiar from Lane that you posted on, coincidentally) so kudos to you & Lane for being so responsive to these questions. I'm doing my entire project on my own without much prior Unity knowledge, so I can't stress how helpful it is to have active members on this forum :D