Change Character Color

Hi! I am making a character for my game and when the character gets hit by an enemy, I want the whole player to turn red and not just turn into a red block, is there any way I can do that?

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited May 2015

    Try this:
    -change attribute self.color red to 1.
    -change attribute self.color green to 0.
    -change attribute self.color blue to 0.

    Mental Donkey Games
    Website - Facebook - Twitter

  • OscarsCodingOscarsCoding Member Posts: 92

    That changed my actor to the right color I want, but how do I change it back to normal?

  • SocksSocks London, UK.Member Posts: 12,822

    @OscarsCoding said:
    That changed my actor to the right color I want, but how do I change it back to normal?

    -change attribute self.color red to 1.
    -change attribute self.color green to 1.
    -change attribute self.color blue to 1.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited May 2015

    Like @Socks said.

    Just a suggestion...
    It gives a nice effect, if instead of changing each color immediately back to 1, you interpolate them. 0.1 or 0.2 seconds for the interpolation time should be good.

    Mental Donkey Games
    Website - Facebook - Twitter

  • SocksSocks London, UK.Member Posts: 12,822

    @NipaDidIt said:
    Like Socks said.

    Just a suggestion...
    It gives a nice effect, if instead of changing each color immediately back to 1, you interpolate them. 0.1 or 0.2 seconds for the interpolation time should be good.

    Agreed, depending on your needs interpolation looks a little nicer. Try making the interpolation times on each colour channel different, so you get hints of other colours in the transition.

    Example

    Interpolate self.color red to 1 - Duration 0.2
    Interpolate self.color green to 1 - Duration 0.4
    Interpolate self.color blue to 1 - Duration 0.8

Sign In or Register to comment.