playMaker

Author Topic: sprite renderer color alpha interpolate[SOLVED]  (Read 2628 times)

nitza12345

  • Playmaker Newbie
  • *
  • Posts: 5
sprite renderer color alpha interpolate[SOLVED]
« on: May 01, 2016, 02:21:47 PM »
guys i tried to interpolate sprite renderer color alpha with set property and float interpolation in fsm everything works fine but the sprite renderer color alpha doesnt change... i face so many problems with playmaker...
« Last Edit: February 06, 2019, 02:01:06 AM by jeanfabre »

ransomink

  • Playmaker Newbie
  • *
  • Posts: 44
Re: sprite renderer color alpha interpolate
« Reply #1 on: May 01, 2016, 04:10:45 PM »
I've used the same method for applying damage color to enemies and fading in/out messages.

Make sure you have a Object variable and its object type is set to Image. Drag the sprite you wish to change to this variable inside the inspector (only if you set it available within the Inspector).

If you can't set it in the Inspector (a prefab—dynamically changes) you have to use the Get Component action to obtain the Image component from the gameobject first. Now, when you use set property it will update the property on that component.

You could snap a screenshot of your FSM with the state selected so we can check the code?

nitza12345

  • Playmaker Newbie
  • *
  • Posts: 5
Re: sprite renderer color alpha interpolate
« Reply #2 on: May 01, 2016, 11:11:37 PM »
Right now i cant post a picture but when I can I will,it's not a prefab,if you drag and drop sprite renderer in to fsm state action Windows it makes you select  get or set property and I selected set property of color.a every frame from a global float variable that is changed by float interpolation every frame,it should work like charm but I will try your method too

ransomink

  • Playmaker Newbie
  • *
  • Posts: 44
Re: sprite renderer color alpha interpolate
« Reply #3 on: May 02, 2016, 04:52:11 AM »
Oh, I thought you were using a Image component. If you attempt my method just make sure the object type of your Object variable is set to Sprite Renderer instead...

Natty

  • Playmaker Newbie
  • *
  • Posts: 1
Re: sprite renderer color alpha interpolate
« Reply #4 on: February 05, 2019, 04:28:34 AM »
Just adding to - since the comments above partially solved my attempt to fade a sprite colour- Don't forget to check update each frame :P or it will look like its not working when in-fact it is! But only colouring the first frame then moving on.
Hopefully this helps somebody else fade their sprites!