Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: miguelfanclub on March 26, 2019, 07:09:32 PM
-
"U Gui Image Set Sprite" seems to not to work anymore when setting the sprite from a sprite var (or object set to Unity.engine - Sprite)
All the sprites var on the target are set to an empty texture without been null.
The var came set from another fsm just right on the "U Gui Image Set Sprite" action
(https://i.imgur.com/KFmgyO3.png)
been "empty" at the target
(https://i.imgur.com/CgpFaQr.png)
-
Hi,
uGui actions should be replaced by the official set so please use UiImageSetSprite.
I will soon completly remove the ugui action and remake the samples to use the built in actions.
Bye,
Jean
-
Ok, i tried now with UiImageSetSprite with same result:
The sprite var came right from another FSM:
(https://i.imgur.com/0ivKP6k.png)
When I send it to the target GO (scroll image right):
(https://i.imgur.com/bEjeeZD.jpg)
Any idea?
-
Hi.
Have you tried setting a break point?
Maybe at the time that you set the image int is not yet in the variable?
Also check in the variables if the image is there and that it is a sprite.
-
Hi,
if you can isolate this, it will help.
make sure you have just one fsm doing just that, and then debug it as Kurt said, it's likely empty at the time of execution and then got filled up.
turn on debugflow for example, and step back, you'll see the values at the time of execution.
that, or another fsm or script is setting that image sprite back to null right after your fsm.
I tested here and it works fine, I did create a fsmVar or type sprite and it worked ( the fsm sprite variable is exactly that, but beautified by the playmaker editor).
Bye,
Jean
-
I see in the 1st picture that in the debug section of the Set Sprite action, there's UniteEngine.Texture2D.
Shouldn't that be UnityEngine.Sprite instead?
-
Hi,
yep, only sprites are allowed.
Bye,
Jean
-
That was it guys.
So you need to drag the sprite component (the square icon child of the image once its converted to 2d Texture) and then it works.