Trouble Getting Arm To Point At An Object With IK?

So, I’ve been fooling around with IK and have been trying to create an effect similar to that in the video linked below. I want to be able to walk up to an object, have my skeletal mesh (arm) detect the object, and reach for it. I’ve tried using the “look at rotation” node and such, but have not been able to get the intended effect. I’d really appreciate an in-depth explanation of how I could go about doing this, as I’m still pretty new to Unreal 4. Thanks a lot in advance!

PS: It’s also worth noting that I don’t have a great grasp on C++, so I do pretty much everything via Blueprints. So an explanation that veered away from C++ would be great.

I know it’s been like a year, but did you ever figure this out? I’m having the same issue now.

Yep! I always intended to post the solution on here but never did. Let me make sure it still works with the latest build and I’ll post a follow-up within the next few days

http://imgur.com/a/CBSzm (Here is an imgur gallery featuring all the screengrabs I intended to have in this post before I found out there was a 5 picture limit.)

Apologies for the wait. There was a bit of a family emergency which delayed my finishing this guide.

So, basically how it works is, there is a collision box surrounding the door (or whatever object you want the arm to be attracted to). When the player either enters or exits the collision box, the following is triggered within the door’s blueprint.

[Door Blueprint] As the comment says, this section inside of the blueprint detects if the player is near the door, casts to the MyCharacter Blueprint, sets off a custom event, gets the transform location of the door knob (really a collision sphere placed over the door knob as in the imgur gallery), changes several other variables and finally enables the player to press a button to open the door.

[MyCharacter Blueprint] In this snippet from the MyCharacter Blueprint the other side of that Interact Event from the previous picture (Door Blueprint) . When it’s triggered, it sets “At Interact” to either true or false, sets Hand Location to the coordinates of the doorknob (come to think of it, you may want to set this to zero whenever “at interact” is false just to keep any unwanted glitches from occurring), and finally sets the Alpha which you can basically think of as the intensity of attraction between the arm and the doorknob. Set to 1 the effect is very noticeable, anything lower gets more and more subtle.

[Animation Blueprint Event Graph] Now that we have the Blueprints sending the required data to the MyCharacter Blueprint, we can move onto the event graph of the Arm’s Animation Blueprint. The above basically just casts to MyCharacter, gets those values, and sets identical variables in the Animation Blueprint to the same respective values.

Then, in the Animgraph in the Animation Blueprint, you need to create a new state machine. (Not pictured due to photo limit)

I have my normal state set to just be the first frame of my “Arm Raise” animation. (Not pictured due to photo limit)

[AtDoor State] This is the inside of AtDoor. It plays the arm raise animation, and uses FABRIK for the IK business.

Here are my FABRIK settings.

This may not be the perfect solution, but it worked for me! Not bad considering there was even less documentation available back when this was made. If you run into any more trouble or anything is confusing just let me know and I’ll do my best to help out!

1 Like

Alright, it says it’s waiting approval but I’ve posted the solution in a hopefully thorough enough manner. Let me know if you have any questions about it and I’ll do my best to help out.

Thank you so much for the details!!! This has helped a lot! I’ve never actually had someone respond to me on here, haha. I don’t have what I want to happen working completely, but I’m a lot closer now! Thanks!

No problem!

Thank you so much, I’ve been trying for two days to do something similar.

Of course! And thanks for the reply. Totally made my day.

One question, It is possible for the arm to return to position after the action (stop FABRIK)? (Return to idl animation for exemple)

I solved my problem by doing a new state machine and then use a blend poses by bool. Thank you again!!!

Hello, ive setup something that looks close to what you have here but im running into a problem where the IK solver (CCDIK) is not really respecting the physics constraints i have on my bones, so each bones starts to rotate in weird ways that are supposed to be locked. Any idea how i can around this issue? Thanks so much

1 Like

Amazing Tutorial can you help to make more intuitive by adding functionalty like:
Hold Button to hold DoorKnob
← → Arrow button press to open forward and backward.
here is question ask many time but didn’t get reply