#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Constant interpolate

Posts: 161Member

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).

• London, UK.Posts: 12,822Member

@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 ?

• Posts: 2,313Member
edited July 2017

You could use the sinus function.

Example from yellow to light blue.

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

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

# ✮ Available for hire! [email protected] ✮

• London, UK.Posts: 12,822Member

cycle thro> @-Timo- said:

You could use the sinus function.

Example from yellow to light blue.

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

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

• Posts: 161Member

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

• Posts: 2,843Member, Sous Chef, PRO

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