Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Lerp function

A topic by BUKKBEEK created Aug 14, 2023 Views: 125 Replies: 6
Viewing posts 1 to 4
Submitted

I just want to clarify a little issue.

I want to change a variable called "x" from 1 to 0.5 in 2 seconds. But the following code won't work. How to solve this?

lerp(1, 0.5, 0.1*timeDelta())

Submitted(+1)

You can tween number variables - both scene and object. 馃憤馃従

Submitted

this works perfectly, thanks. Any idea how to use lerp as well?

Submitted

Nah sorry man.

Submitted

Well I think 0.1 * timedelta() isn't gonna be 2 seconds, time delta is the time between frames, I think your doing it at a 10th of the time between frames(don't quote me on that, I'm kinda new to the lerp action)

either way I don't think that's 2 seconds

Submitted

yeah. this doesn't work anyway.

Submitted

Also instead of one you might have to just put in the variable, and have it be one when this happens? not sure