Attach actor to mouse cursor, with offset

I’ve posted this on the answer hub without any feedback, so moving to here to see if I get better luck.

(How can i have the mallet be slightly offset when I move the mouse cursor around the play area? - Programming & Scripting - Epic Developer Community Forums)

In my basic wac-a-mole game, I have a mallet which I want to follow the mouse cursor around the play area. The mallet needs to be slightly offset in the Z. When I click the mouse, the mallet wac’s the mole.

The mallet in my current implementation does move a little bit with the mouse, but no where near where I need it to be. It is like the movement scale needs to increase, or I’ve approached this incorrectly.

In my game image, the mouse cursor is on the far left of the screen, but the mallet has only moved a fraction in the correct direction.

What I am doing wrong?

I’d say toss a Vector * Float node between your “Make Vector” and “Make Transform”. Getting the multiplier value correct will be tricky, I’d start with 20 or so.

If you’re looking for a more elegant solution… sorry, I don’t have one.

your mouse is moving on a plane, your hammer is moving on another. so what you need is a projection(usually involving normalized your source and then project to your target, like rendering does). this would allow you to do arbitrary level/camera combination as well.

now, probably doing it involves doing math with transformation nodes, but UE4 did most of that for you for the mouse to screen part. what you now have to do is have 2 3d vector widget for your blueprint to define the top left and bottom right corner of your table. the rest in just simple linear remapping.

thanks guys, as a complete beginner. I’m not really sure where to start with that. I might return to this project when I understand what was just said a little better.