playMaker

Author Topic: Can Playmaker handle multiple object animations on GUIslider [SOLVED]  (Read 4587 times)

dubnug

  • Playmaker Newbie
  • *
  • Posts: 22
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.
« Last Edit: February 03, 2013, 02:38:41 AM by dubnug »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Yes.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

dubnug

  • Playmaker Newbie
  • *
  • Posts: 22
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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

dubnug

  • Playmaker Newbie
  • *
  • Posts: 22
awesome, thanks for your help.

dubnug

  • Playmaker Newbie
  • *
  • Posts: 22
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  :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

dubnug

  • Playmaker Newbie
  • *
  • Posts: 22
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