Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Jeps on January 14, 2016, 09:10:15 AM

Title: Swap Sprite action won't accept Object variable [SOLVED]
Post by: Jeps on January 14, 2016, 09:10:15 AM
Hi

I'm having an issue with the Swap Sprite action. I can't assign a variable to the "Sprite To Swap". I have an Object variable defined with a sprite as "Object Value", but I can't select it in the Sprite Swap action - the "Sprite To Swap" only shows "None"
Since I'm selecting between a number of sprites it would be great to get this to work. On Unity 5.3.1 and PM 1.7.8.4 (1.8.0 Beta 40).

Best regards

J
Title: Re: Swap Sprite action won't accept Object variable
Post by: jeanfabre on January 21, 2016, 10:07:06 AM
Hi,

 you need to properly set the object type of your FsmObject variable to "UnityEngine.Sprite"

else you need to drag and drop the Sprite Component itself, not the GameObject, if you drag a GameObject into a Inspector Field, it will catch the GameObject, but won't understand you want to reference its Sprite component.

Bye,

 Jean
Title: Re: Swap Sprite action won't accept Object variable
Post by: Jeps on February 23, 2016, 10:29:18 AM
Hi Jean

Sorry for this very late reply - I've been away from the project and haven't checked the forum.
I just wanted to say thank for your help. It works perfectly - the problem was that I wasn't aware of the selection option under Object Type in the Variable settings.
So rookie mistake by me, but thanks for helping out!

Best regards

J.