playMaker

Author Topic: [SOLVED] Revert state / transparent over time  (Read 3322 times)

Uttpd

  • Junior Playmaker
  • **
  • Posts: 70
[SOLVED] Revert state / transparent over time
« on: July 08, 2012, 02:30:42 PM »
Hi
Trying to get my character transparent over time/ move dependent

I´m using "Time In Current State" to get the seconds) my character is idle, when this value is higher than 5 --> I change the color/ alpha of my character (a 2dToolkit sprite) using "float Compare"
when is 0 (when the character moves) it should go back..

I can change the color of the character with "TK2d Sprite Set Color" action, But cannot revert it back!! After applying this action it always stays with the new color

My FSM works --> the states change as expected but the sprite does not go back to his original ???

additionally:
b) I just want to change the Alpha Value allowing me to control only the transparency on my sprite.



Thanks
« Last Edit: July 09, 2012, 11:52:31 PM by Uttpd »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Revert state / transparent over time
« Reply #1 on: July 09, 2012, 04:12:49 AM »
hi,

 It looks like a conflict between fsms. It's likely that two fsm are fighting for the setting the color. Or you might have an action not set up the way you think.

do you really only have one fsm that access this sprite color?

bye,

 Jean

Uttpd

  • Junior Playmaker
  • **
  • Posts: 70
Re: Revert state / transparent over time
« Reply #2 on: July 09, 2012, 06:09:18 AM »
hum nope

This is my only attempt to mess with the color. I have this as a second FSM on a cube game object that contains my 2Dtoolkit animated sprite (the other FSM controls  the Idle/ walk move)





Thats the full FSM, its very simple.. Tried with the enable/ reset event action but could not make it work either

Thanks
« Last Edit: July 09, 2012, 06:10:57 AM by Uttpd »

Uttpd

  • Junior Playmaker
  • **
  • Posts: 70
Re: Revert state / transparent over time
« Reply #3 on: July 09, 2012, 11:50:53 PM »
 :) fixed,
got around it by using a unity default shader (transparent softunlit) instead of the 2DToolkitk shader. It seems the 2kt shaders are imune to material changes, and i could not change it to comply.

Used "itween fade in" (thanks to the user who shared it) as the set Material color made my sprite flick/ blink
« Last Edit: July 09, 2012, 11:55:46 PM by Uttpd »