Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: miguelfanclub on September 29, 2018, 12:48:59 PM

Title: [SOLVED] Get/Set Sprite variable
Post by: miguelfanclub 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??
Title: Re: Get/Set Sprite variable
Post by: Thore 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,
Title: Re: Get/Set Sprite variable
Post by: miguelfanclub 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?
Title: Re: Get/Set Sprite variable
Post by: Fat Pug Studio 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.
Title: Re: Get/Set Sprite variable
Post by: miguelfanclub 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
Title: Re: Get/Set Sprite variable
Post by: Fat Pug Studio on September 30, 2018, 07:13:32 AM
https://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Sprite/SetSprite.cs

As for get sprite: http://hutonggames.com/playmakerforum/index.php?topic=19349.msg84332#msg84332
Title: Re: Get/Set Sprite variable
Post by: miguelfanclub 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

Title: Re: Get/Set Sprite variable
Post by: miguelfanclub on October 02, 2018, 03:59:42 AM
bump
Title: Re: Get/Set Sprite variable
Post by: jeanfabre 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.

(https://i.imgur.com/SnKcroL.png)

Bye,

 Jean
Title: Re: Get/Set Sprite variable
Post by: miguelfanclub on October 03, 2018, 06:23:51 PM
And that worked.
Thanks a lot.