Is there any way to control VInterp with the mouse wheel?

Hi!

I wondering if there is any way to control VInterp with the mouse wheel.

I want to do a piece of the movement every time the player move the mouse wheel up.

How can I do it?

Thanks.

2 Likes

VInterp interpolates from A to B by a factor every time you call it, which is in Everynone’s case not a constant value and stops interpolating after the first call.

This is one of the rare cases I actually use the Tick function instead to do the interpolation.

I’d store a target vector value like “TargetPosition”. Then every time I move the mouse wheel up or down I’d add a value like 15 or -15 to an axis on the target vector. On the Tick event I’d interpolate the the current position (SomeActor->GetActorLocation()) to the target position. This feels very smooth if used with input based camera zoom-in / zoom-out.

1 Like

What if I told you that it works just fine? :slight_smile: Axis inputs execute every frame.

This feels very smooth if used with input based camera zoom-in / zoom-out.

There is no need for additional Tick + Gate, a single event is enough:

On the other hand, Gates are more than fine - you actually get to control stuff.

1 Like

Oh you are right, apoligies. I assumed this was an Action event, not an axis event. Recently I replied to someone who mixed up the button-like behavior of a mouse wheel after using an axis event :smile: . In this case you could use an axis event instead of tick perfectly fine as it executes every frame anyway.

1 Like

I think Mouse Wheel Up and Mouse Wheel Down are action events.

If you do not want to use an Axis event, @Roy_Wierer.Seda145’s suggestion is the way to go then. The event would set target value and the VInterpTo will take you there during Tick. You’d need a couple more nodes but the end result will be the same.

1 Like

you can make an array of vectors (positions) and control the INDEX of that array with the mouse wheel then you can just Vinterp current position with array[index] position all the time.