I have that inside my update function and it works fine. The “From” and “To” are empty game objects. I have been trying all day to mimic it going back the other way after it has finished lerping but cant. In other words, the object going back from direction “To” to “From”
If you’re trying to rotate something, consider a tweening engine. They are much better at handling this and really easy to setup.
If you want to go back, I’m not sure why you couldn’t just swap to.rotation and from.rotation…
But to understand Time.time * rs should be a value between 0 to 1. If it’s at 0, then that means you’re at the from value. If it’s at 1, that means you’re at the to value. So if you use the same code and instead, move from 1 to 0, you’ll end up going backwards.
The way I’ve done it in the past is to initialize a float to 0, then add an amount to it and use that as the movement speed. Then once it hits 1, you reverse and start subtracting from the value. This will create a back and fourth effect.