Announcement

Collapse
No announcement yet.

Need help : picking up and attaching object to socket

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help : picking up and attaching object to socket

    Hello everyone,

    I'm new to this, been reading and watching every tutorial i could find, but i can't see what i'm doing wrong.

    So, i want my character to be able to pick up a specific object (The_Ball) by clicking LeftMouse when The_Ball overlaps with my character's 'Grab_Ball' collision box and attach it to a socket. Problem : when i click, the ball moves to the right position, but doesnt stick there and falls through the floor. Here's what my BP looks like so far :

    Function Grab_Ball :
    Click image for larger version

Name:	UE4_trouble2.png
Views:	1
Size:	146.8 KB
ID:	1145214

    And calling it with left click:
    Click image for larger version

Name:	UE4_trouble3.png
Views:	1
Size:	31.9 KB
ID:	1145215

    Actors, components, meshes, this is quite confusing to me.

    Thanks for your help!

    #2
    Hey, the issue here is that while the ball is attached to the socket, physics are still active on it. Try calling Deactivate on the ball when attaching and Activate on the ball when detaching. You can also try SetEnablePhysics(false / true).
    Journeyman's Minimap - Available on Marketplace - Forum topic - Video

    Comment


      #3
      That's what i think too, but i don't have access to that option for my variable. I think it's because it refers to an actor while it should be the mesh component of that actor. But i don't know how to have acces to the ball mesh here because i'm in the character blueprint.
      Maybe i just did this completly wrong

      Comment


        #4
        Ok, it now works, but i'm really not sure my method is the right one But that's how you learn

        Here's what i did
        Click image for larger version

Name:	UE4_trouble4.png
Views:	1
Size:	158.0 KB
ID:	1067681

        Comment

        Working...
        X