Control player's arms with the mouse?

Hello,

For my game, I require the abillity to move both of the player’s arms (kind of like Surgeon Simulator) using the mouse. I’m pretty sure I need to use the Two-Bone IK node, however I can’t seem to get to work with the mouse. At best, the arm moves a few units to the side or forward, jitters, then moves back to the starting location. I have also tried using an aim offset for the arms, but it doesn’t work too well.

I set the viewport to move when I hold down right mouse button and drag so that I could control the viewport and arms with the mouse.

What I am looking for is to be able to move the arm forward with Mouse Y, side to side with Mouse X, and then up and down with a keyboard button press.

Does anyone know of any nodes or setup that could handle this system with the mouse? (Also, it seems to work fine when using key presses, just not the mouse in which I need.)

(Also, what would I use to make it so the arms collide with the environment and with the player so that the arms don’t clip through everything (as I plan to have the arms manipulate the environment).)

Well, I actually got the first part to work after messing around with it some more. What I did is I got the value of the arm’s position and added that to the axis value of Mouse X / Mouse Y and output the new value back into the arm’s position.

Works pretty nicely without any tweaking. I still don’t know how to enable collision on the arm with the environment though.

Hi Phystrontium,

A good way to do this is provide individual collision spheres for each portion of the arm and set these to “BlockAll”. This provides a more dynamic approach to collision for individual components of the arm instead of one big block. This will also allow you to provide individual actions to occur if specific components of the arm interact with other objects (for instance in the simulator example, what would happen if the player’s forearms bumped a table, etc?).

Hello ,

Thank you for the reply. Now, what do you recommend to use for the collision spheres? I’ve tried attaching static meshes that fit the individual portions of the arm to sockets through the level blueprint, but once it attaches the character’s movement and collision gets messed up. Are there any settings I need to set, or is there another way of doing this?

If you look in the components tab of your blueprint under the dropdown menu you should see an object just called “Sphere”. This is an overlap sphere much like volumes and can be used for what you are looking for.

I have added the sphere into my character’s blueprint and attached it to the correct bone, although no collision seems to occur, even when set to “Block All”. Is there any way I can use the Physics Asset for collision?

Give the nodes please.