playMaker

Author Topic: [SOLVED] Get/Set Sprite variable  (Read 827 times)

miguelfanclub

  • Full Member
  • ***
  • Posts: 151
    • View Profile
[SOLVED] Get/Set Sprite variable
« on: September 29, 2018, 09:48:59 AM »
Sprite is a variable type in Playmaker.
Then no action to Get or Set (as the rest of the variable types)
Why??
« Last Edit: October 03, 2018, 03:24:16 PM by miguelfanclub »

Thore

  • Sr. Member
  • ****
  • Posts: 325
    • View Profile
Re: Get/Set Sprite variable
« Reply #1 on: September 29, 2018, 11:10:42 AM »
Hi,

You can drag and drop the sprite renderer component to where you place the actions, and it will create a get/set property action, where you can configure what you want to get ort set. To do this most easily, mind the lock functionality in both the inspector as well as the FSM.

Alternative, you can create an object variable type (in variable pane), and then set object type: navigate the drop down lists (press U a few times and find Unity Engine, and then in the submenu, press S a few times to find sprite) and you should have what you need.

Finally, take a look at Linker Wizard (tutorials on YouTube, tool in Playmaker menu).

Cheers,

miguelfanclub

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Get/Set Sprite variable
« Reply #2 on: September 29, 2018, 02:16:51 PM »
I guess i can also do same stuff to get an int or a complex workaround to set a float, but thing is with a simple get or set, you set an int, a float, a game obejct.... but not a sprite.

Again.

Why?

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 990
    • View Profile
    • Fat Pug Studio
Re: Get/Set Sprite variable
« Reply #3 on: September 30, 2018, 02:33:45 AM »
There is get/set sprite on ecosystem, sprite type is now supported in Playmaker, no need for texture mumbo jumbo.

miguelfanclub

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Get/Set Sprite variable
« Reply #4 on: September 30, 2018, 03:15:20 AM »
@krmko
I dont see them. I see other stuff to do with sprite types but not the simple set/get to just pass the variable to/from FSMs

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 990
    • View Profile
    • Fat Pug Studio
« Last Edit: September 30, 2018, 04:17:02 AM by krmko »

miguelfanclub

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Get/Set Sprite variable
« Reply #6 on: September 30, 2018, 11:41:47 AM »
No, the get sprite from the ecosystem gets  the sprite.render component into a variable. The Game object I want the sprite variable from is a regular game object with 50 variables sprite types.

I need a GET from an fsm sprite variable to another fsm sprite variable

Like we do with Ints, floats etc etc


miguelfanclub

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Get/Set Sprite variable
« Reply #7 on: October 02, 2018, 12:59:42 AM »
bump

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14485
  • Official Playmaker Support
    • View Profile
Re: Get/Set Sprite variable
« Reply #8 on: October 02, 2018, 11:44:58 PM »
Hi,

 PlayMaker introduced a wrapper around FsmObject where you can define a type and it will list it in the variable list, but under the hood it's not a new fsmXXX, it's an FsmObject of type XXX

 so simply use GetFsmObject and you will see listed the sprite variable.



Bye,

 Jean

miguelfanclub

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Get/Set Sprite variable
« Reply #9 on: October 03, 2018, 03:23:51 PM »
And that worked.
Thanks a lot.