Lerping issues

        this.cameraMain?.position.lerpVectors(this.cameraMain?.position, this.cameraPoints[this.index].position,this.clock.getDelta()/5);

Hi there, I am using these lines to lerp my rotation and position, and I am encountering something unusual.
It seems like only the top line gets executed.. so in the case of above, the camera will move but not rotate. If I swap the lines over, it will rotate but not move.

I am little confused by this lol Am I doing something silly like resetting the pos/rot? both lines are working, but just one at a time lol

[Original Post on Discord](https://discord.com/channels/717429793926283276/1036678023455449159)

*by user 95852307077406720*

The lines look fine, could it be related to get delta being 0 since you call it immediately again?

You can use this.context.time.deltaTime instead

This worked thank you. It must be something with that delta then!

by user 95852307077406720

I think getDelta will return the delta to the last time you called it, so immediately calling it twice will return some value on the first call but zero on the second.
Caching the value (what time.deltaTime does internally) makes sure you get the same value in both.

Also @Dean just in case you dont know: you can get the current camera using this.context.mainCamera too :slightly_smiling_face:

Thank you! I appreciate the help. It’s interesting working with needle because I have to rethink how I would typically do things using C#. It’s actually refreshing in some ways.

Quick question though! How do I determine which direction the mousewheel has changed? I am using this, but of course that’s just a bool -

by user 95852307077406720

Ah right - that seems to be missing. I’ll add it for the next update. in the meantime you can do something like that:

document.body.addEventListener("wheel", evt => evt.deltaY)