playMaker

Author Topic: Swap Sprite action won't accept Object variable [SOLVED]  (Read 1265 times)

Jeps

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Swap Sprite action won't accept Object variable [SOLVED]
« on: January 14, 2016, 07: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
« Last Edit: February 24, 2016, 04:08:09 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15396
  • Official Playmaker Support
    • View Profile
Re: Swap Sprite action won't accept Object variable
« Reply #1 on: January 21, 2016, 08: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

Jeps

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Swap Sprite action won't accept Object variable
« Reply #2 on: February 23, 2016, 08: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.