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"

Picking up object and attaching it to another object

I want to pick up a ladder and attach it to the ceiling but I have no idea how I can do that. I already made a blueprint to pick up items with E and now I want to create a triggerbox where I can press E again to attach the ladder to the ceiling.

I can't find a solution to my problem so that's why I'm asking for help so I hope you guys can help me with any tips or links. If you need my blueprint then I can provide that too.

Product Version: UE 4.12
Tags:
more ▼

asked Apr 04 '17 at 03:23 AM in Using UE4

avatar image

Justt033
3 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey there,

This sounds like a good way to use Interfaces. So, right click inside a folder and choose Blueprints -> Blueprint Interface and name it "BPI_LadderAttachable".: alt text Inside it, add a function called "TryToAttachLadder" that gets an Actor Reference as Input and outputs a Boolean. call the input LadderRef and output Success: alt text

Create an Actor called "BP_LadderTrigger" or whatever you feel like calling it. Inside it, go to "Class Settings" and in "Interfaces" choose "Add" and add the interface BPI_LadderAttachable that we created: alt text Inside this Actor, add two components: (1) Scene component called "LadderAttachPoint" (2) Box collision (to detect when player is near). Compile actor and then, in My Blueprints tab, usually on the left of screen, look for the Interface Function we created called "TryToAttachLadder". Inside this function simply drag the LadderRef and choose "AttachToComponent". The component will be the LadderAttachPoint. make sure it's location and rotation Snap To Target. Afterwards, return Success: alt text Last step is: go to your character (which holds ladders on E) and add the following logic: When you grab a ladder, save it in a "HeldLadder" variable. When E is pressed, check if HeldLadder is valid. If it is, get all overlapping actors of type "LadderTrigger" (if player inside the Box Collision we created, it will trigger) and try to attach a ladder to them using the Interface call we created. If the ladder was attached to something, we will set HeldLadder to be Null to know we are no longer holding it. If HeldLadder is InValid, we will try to attach a ladder to player (using the method you said you already implemented). alt text

Hope this helped. Tried to be as specific as possible.

Good luck

screenshot_3.png (231.1 kB)
screenshot_8.png (30.2 kB)
screenshot_9.png (209.4 kB)
screenshot_7.png (240.5 kB)
screenshot_2.png (295.7 kB)
more ▼

answered Apr 04 '17 at 07:34 AM

avatar image

DDraiman1990
151 4 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Oké thank you very much, Im going to try it out and see how far I can get! I'll let you know when I've done it.

more ▼

answered Apr 04 '17 at 04:39 PM

avatar image

Justt033
3 2 2

avatar image DDraiman1990 Apr 06 '17 at 04:49 AM

If it worked, please mark what I wrote as the answer so others can use this thread too. Thanks :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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