Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: sapigwetao on July 06, 2020, 11:35:16 AM

Title: Help with [Set Sprite Color]
Post by: sapigwetao on July 06, 2020, 11:35:16 AM
Hello, i wanted to make my enemy or player flashing when get hit.
I tried to use Set Sprite Color from ecosystem, and its not change anything when the player bullet colliding the enemy.

Anywone know this solution?

Thank you
Title: Re: Help with [Set Sprite Color]
Post by: djaydino on July 06, 2020, 02:27:37 PM
Hi.
Probably you have a sprite animation.

If so you can use 'Set Material Property Block Color' (you can find it on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

Set Property Name to "_EmissionColor"

Also you might need to use 'Set Material Property Block Float' to manipulate the "_EmissionPower"
Title: Re: Help with [Set Sprite Color]
Post by: Thore on July 06, 2020, 03:11:37 PM
First set it by hand to see if it even works. Sprite color only applies a tint where white is just the original colour. I had to make my own shaders to get an overlay color to make it flashing white.
Title: Re: Help with [Set Sprite Color]
Post by: sapigwetao on July 07, 2020, 01:46:10 AM
Hi.
Probably you have a sprite animation.

If so you can use 'Set Material Property Block Color' (you can find it on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

Set Property Name to "_EmissionColor"

Also you might need to use 'Set Material Property Block Float' to manipulate the "_EmissionPower"


is it done like this?
because its take no effect form me too

Anyway this fsm i set when the Player bullet is hitting the enemy
Title: Re: Help with [Set Sprite Color]
Post by: djaydino on July 07, 2020, 09:52:48 AM
Hi.
Here is a setup i use in our game :

(https://i.imgur.com/lE5Joif.png)

(https://i.imgur.com/Z5DeqDC.png)

(https://i.imgur.com/klapPMy.png)

If 'Use Owner' Is set then the fsm has to be on the object with the sprite renderer component.

Increasing the Emission Power will make it more clear. you can test on the material on a object manually.

(https://i.imgur.com/WXwNyso.png)

(https://i.imgur.com/BweMMe0.png)

Title: Re: Help with [Set Sprite Color]
Post by: sapigwetao on July 10, 2020, 02:06:04 AM
Hi.
Here is a setup i use in our game :

(https://i.imgur.com/lE5Joif.png)

(https://i.imgur.com/Z5DeqDC.png)

(https://i.imgur.com/klapPMy.png)

If 'Use Owner' Is set then the fsm has to be on the object with the sprite renderer component.

Increasing the Emission Power will make it more clear. you can test on the material on a object manually.

(https://i.imgur.com/WXwNyso.png)

(https://i.imgur.com/BweMMe0.png)

Thanks, i will try it later, and i will followuping you if this was work or not. Thanks dude!
Title: Re: Help with [Set Sprite Color]
Post by: sapigwetao on July 13, 2020, 07:27:19 AM
Hi.
Here is a setup i use in our game :

(https://i.imgur.com/lE5Joif.png)

(https://i.imgur.com/Z5DeqDC.png)

(https://i.imgur.com/klapPMy.png)

If 'Use Owner' Is set then the fsm has to be on the object with the sprite renderer component.

Increasing the Emission Power will make it more clear. you can test on the material on a object manually.

(https://i.imgur.com/WXwNyso.png)

(https://i.imgur.com/BweMMe0.png)


Hey im just realized why i cant change the color, even i try your tips.
Here is it.

first im not using spritesheet for my character and enemies.
i splitting each body and combined it into one Game Object called "Player", and i animated it using unity Animation.

also my Game Obj called "Player" has no sprite renderer, mash renderer etc.

and i think thats why i cant turn Player or enemies into flashing red when i hit the enemy. Each body of my sprites has it own sprite renderer.

and yet i still cant solved it.
Title: Re: Help with [Set Sprite Color]
Post by: djaydino on July 13, 2020, 12:07:20 PM
Hi.
Then you should try to set  the sprite color for each body part.

Or if each body part has the same material (but material should not be shared with something else).

Then you should try Set Material Color instead of Set Material Property Color.
And drag in the material to change color on.