Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Daffodil on April 15, 2023, 01:46:25 PM

Title: Image varible?
Post by: Daffodil on April 15, 2023, 01:46:25 PM
Hi all, I am new here! Nice to meet you all!

I am getting my head around Playmaker and so far so good, its just I cannot seem to find if its possible to save an image to a varible and be able to call up again later on?
Title: Re: Image varible?
Post by: Tubbritt on April 16, 2023, 09:59:01 AM
Did you set the variable to “Texture” so that it can store the image, and not just text or values? See attached iamge for example.
Title: Re: Image varible?
Post by: Daffodil on April 16, 2023, 02:01:32 PM
I have assigned it to Texture, but I cannot seem to figure out how to call that now.
Title: Re: Image varible?
Post by: Tubbritt on April 16, 2023, 04:35:53 PM
Hello.
Use the action “Set Texture Value” to specify the image you want to store in your Variable.

You can then use the action “Set Material Texture” to load the contents of the variable into any Material. See attached image for an example.
Title: Re: Image varible?
Post by: djaydino on April 17, 2023, 08:10:15 AM
Hi.
For (Canvas) Image component, you need to use 'UI Image Set Sprite'.
and use the sprite variable.

for Sprite Renderer component, you can use 'Set Sprite'

texture is mostly use for 3d objects and materials
Title: Re: Image varible?
Post by: Daffodil on April 17, 2023, 10:28:57 AM
Hi.
For (Canvas) Image component, you need to use 'UI Image Set Sprite'.
and use the sprite variable.

for Sprite Renderer component, you can use 'Set Sprite'

texture is mostly use for 3d objects and materials

Hiya, I am attempting this (you are quite right, it is 2D UI) I cant set it as a sprite in variables, it keeps defaulting to GameObject.
Title: Re: Image varible?
Post by: Daffodil on April 17, 2023, 12:50:15 PM
I got it work! Thank you!