Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ca on October 16, 2019, 07:06:26 AM

Title: Set material texture [SOLVED]
Post by: ca on October 16, 2019, 07:06:26 AM
Hello,

I want to make the player have some motion so I want to set two pictures using “set material texture “ to change second by second, but it doesn’t work!
Title: Re: Set material texture
Post by: djaydino on October 16, 2019, 01:34:11 PM
Hi.
Is this for 2d character?
if so you can use sprites and the animator with some animations
Title: Re: Set material texture
Post by: ca on October 16, 2019, 08:40:16 PM
yes 2D. thank you!
because it is so simple just two pic exchange both.
so, I set two states in a FSM on the game object,
state A:
set Material texture use textureA
wait 1 sec
state B:
set Material texture use textureB
wait 1 sec

and, I can do it 2-3 year ago with old unity, but nowadays updated unity to 2019.2 then it doesn't work.

thank again!
Title: Re: Set material texture
Post by: djaydino on October 17, 2019, 03:48:38 AM
Hi.
if 2D you should use Set Sprite action

and swap the sprite image on the sprite renderer not the material.

Title: Re: Set material texture
Post by: ca on October 17, 2019, 08:24:18 AM
which action will use?
UI Image Set Sprite?
but it still doesn't work :(
thank you!!
Title: Re: Set material texture
Post by: djaydino on October 17, 2019, 01:49:00 PM
Hi.
Ui image is for canvas ui images.

Sorry i thought the sprite actions where already included in the latest PM version.
The sprite actions will come in the next update.

For now you can get some sprite actions from the  Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) you can find 'Set Sprite' / 'Swap Sprite' actions.
Title: Re: Set material texture
Post by: ca on October 17, 2019, 09:07:22 PM
Oh I see.
I never use the Ecosystem before you told me.
I found set sprite now and it work perfect!

thank you!!