x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

https://www.youtube.com/watch?v=h5SjwrJen3o#t=86

Product Version: Not Selected
Tags:
more ▼

asked Feb 14 '15 at 07:06 AM in Using UE4

avatar image

Megamansalzar
26 3 5 9

avatar image alliways Feb 01 '16 at 12:57 AM

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

avatar image Megamansalzar Feb 01 '16 at 05:01 AM

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

avatar image Megamansalzar Feb 08 '16 at 02:51 AM

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.

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

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.

alt text

[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.

alt text

[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.

alt text

[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)

alt text

[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.

alt text

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!

unreal 2.png (142.2 kB)
unreal 3.png (64.0 kB)
unreal 4.png (102.1 kB)
unreal 7.png (129.0 kB)
unreal 8.png (25.0 kB)
more ▼

answered Feb 08 '16 at 02:56 AM

avatar image

Megamansalzar
26 3 5 9

(comments are locked)
10|2000 characters needed characters left

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!

more ▼

answered Feb 10 '16 at 09:18 PM

avatar image

alliways
1 1 2

avatar image Megamansalzar Feb 13 '16 at 01:50 AM

No problem!

avatar image Uedan Apr 08 '17 at 11:09 PM

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

avatar image Megamansalzar Apr 09 '17 at 04:53 AM

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

avatar image Uedan Apr 09 '17 at 10:15 PM

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

avatar image Uedan Apr 10 '17 at 12:19 AM

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

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question