playMaker

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

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
[SOLVED] Get/Set Sprite variable
« on: September 29, 2018, 12:48:59 PM »
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, 06:24:16 PM by miguelfanclub »

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Get/Set Sprite variable
« Reply #1 on: September 29, 2018, 02:10:42 PM »
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: 165
Re: Get/Set Sprite variable
« Reply #2 on: September 29, 2018, 05: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?

Fat Pug Studio

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

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Get/Set Sprite variable
« Reply #4 on: September 30, 2018, 06: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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
« Last Edit: September 30, 2018, 07:17:02 AM by krmko »
Available for Playmaker work

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Get/Set Sprite variable
« Reply #6 on: September 30, 2018, 02:41:47 PM »
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: 165
Re: Get/Set Sprite variable
« Reply #7 on: October 02, 2018, 03:59:42 AM »
bump

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get/Set Sprite variable
« Reply #8 on: October 03, 2018, 02:44:58 AM »
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: 165
Re: Get/Set Sprite variable
« Reply #9 on: October 03, 2018, 06:23:51 PM »
And that worked.
Thanks a lot.