playMaker

Author Topic: Help with [Set Sprite Color]  (Read 2019 times)

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Help with [Set Sprite Color]
« 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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Help with [Set Sprite Color]
« Reply #1 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)

Set Property Name to "_EmissionColor"

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

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Help with [Set Sprite Color]
« Reply #2 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.

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Help with [Set Sprite Color]
« Reply #3 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)

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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Help with [Set Sprite Color]
« Reply #4 on: July 07, 2020, 09:52:48 AM »
Hi.
Here is a setup i use in our game :







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.






sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Help with [Set Sprite Color]
« Reply #5 on: July 10, 2020, 02:06:04 AM »
Hi.
Here is a setup i use in our game :







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.





Thanks, i will try it later, and i will followuping you if this was work or not. Thanks dude!

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Help with [Set Sprite Color]
« Reply #6 on: July 13, 2020, 07:27:19 AM »
Hi.
Here is a setup i use in our game :







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.






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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Help with [Set Sprite Color]
« Reply #7 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.