Interpolating visible instances' properties on the client

To add a little context; this is for some vfx which will go client side. This usually would be changing the scale of some meshes or the position of an attachment, as well as colour, brightness and transparency properties of instances they apply to.

Solutions that come to mind are client-side tweens or incrementally lerping the properties and using either heartbeat or renderstepped.

Ideally I would like to lerp, as sometimes the desired final value can change during the easing process due to mechanics in the game, such as freezing time.

My questions are:
Will I lose out on performance significantly if I lerp instead of tween?
Should I bind the lerping function to renderstepped or will heartbeat suffice?
Should I really be tweening incrementally instead? (not as frequently as heartbeat or renderstepped of course)
Should I use the same method for rotating baseparts?

3 Likes

Will I lose out on performance significantly if I lerp instead of tween?

The performance of lerping depends on how much lerping occurs, If you’re replacing one tween with lerp, there shouldn’t be much of a performance loss, Tweening is usually very choppy due to freeze time as you’ve mentioned so personally I would be inclined to use lerping but try to control the amount of lerping that is happening.

Should I bind the lerping function to renderstepped or will heartbeat suffice?

Heartbeat should suffice as you may already face performance problems, according to this article:

Renderstepped is proved to cause a strain on performance.

Should I really be tweening incrementally instead? (not as frequently as heartbeat or renderstepped of course)

Not 100% sure about this one sorry.

Should I use the same method for rotating baseparts?

If you’re handling the lerping from one handler script & bindeable events then sure go for it.

2 Likes