Constant interpolate

SEMASEMA Member Posts: 161

I am making an actor be constantly changing color, with a interpolate behavior but it only does it once. I want it to be constantly interpolating.(sorry for my bad grammar).

Comments

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

    @SEMA said:
    I am making an actor be constantly changing color, with a interpolate behavior but it only does it once. I want it to be constantly interpolating.(sorry for my bad grammar).

    What colour is it changing from and to ?

  • -Timo--Timo- Member Posts: 2,313
    edited July 2017

    You could use the sinus function.

    Example from yellow to light blue.

    Constrain self.color.red to 0.5sin(100self.Time)+0.5
    Constrain self.color.blue to 0.5sin(100self.Time+180)+0.5

    You can also interpolate the color back.

    If self.color.red = 0
    interpolate self.color.red to 1

    if self.color.red = 1
    interpolate self.color.red to 0

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

    cycle thro> @-Timo- said:

    You could use the sinus function.

    Example from yellow to light blue.

    Constrain self.color.red to 0.5sin(100self.Time)+0.5
    Constrain self.color.blue to 0.5sin(100self.Time+180)+0.5

    You can also interpolate the color back.

    If self.color.red = 0
    interpolate self.color.red to 1

    if self.color.red = 1
    interpolate self.color.red to 0

    multiplication symbols were lost in Timo's post, it should read:

    Constrain self.color.red to 0.5*sin(100*self.Time)+0.5
    Constrain self.color.blue to 0.5*sin(100*self.Time+180)+0.5

  • SEMASEMA Member Posts: 161

    I am taking the colors from a table. I have an attribute called "color", which states the row of the color

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Check out the attached demo project. It might be useful.

Sign In or Register to comment.