How to use APlayerController::GetInputMouseDelta?

The input parameters are passed by reference (&), also known as an out parameter.

What that means, is that any values passed to the function will be modified.

In short, you need to create 2 variables you can pass into the function, call the function with those 2 variables, and the function will modify those 2 variables values.

So something like:
float DeltaX = 0.f;
float DeltaY = 0.f;

GetInputMouseDelta(DeltaX, DeltaY);

Now DeltaX’s and DeltaY’s values have changed to whatever.

EDIT: Also, “Delta” is a keyword of sorts in Unreal Engine, and it refers to “since last frame”. DeltaTime is the time since last frame, so DeltaX and DeltaY will be the X and Y since last frame.

There’s a really good explanation on pointers and references on reddit. Comment by RoyAwesome.

1 Like