Trouble with Attach Actor to Component interacting with a VR motion controller

Hello,

I’m pretty new to Blueprints & am having trouble with Attach Actor to Component interacting with a VR motion controller.

I have built a DC power supply with sockets (that’s gonna get confusing!) and wire leads with static mesh plugs. I can pick up the plugs and attach them On Overlap to the power supply nicely, while I continue to hold the grip button on the motion controller. The problem arrives with the On Dropped event which occurs when releasing the grip button. This appears to nullify the Attach Actor function, and the plug detaches from the socket.

I have tried using the On Dropped event to recall Attach Actor to Component, which works if I explicitly specify which component to attach to. All good until I want to attach the wire to a different component and I can’t get it off the first.

I have tried ripping off and modifying the GetGrabComponentNearMotionController to find the nearest component and attach On Dropped, but no joy as array functions don’t seem to like passing StaticMeshComponents.

Any assistance would be greatly appreciated!

You’re trying to connect it to a socket named “Socket” Open the skeletal mesh and create a socket and name it. Insert the name inside the “socket name” option on the “AttachActorToComponent” node. Unless you named your socket “Socket”. If that’s the case and Socket names are fine, you said you’re having issues with removing from another component? Have you tried “DetachFromActor” or “DetachFromComponent”?

Hey mikeyy904, yes SM_Socket_Red is a mesh component of BP_PSU with a socket called “Socket”. Yes, I made this confusing. I’ll change the socket name to BananaSocket. The Plug attaches to the socket exactly as intended.

The primary issue occurs when I release the motion controller Grab button, which (for some reason) detaches the actor. My problem would be solved if someone could tell me about best practices for keeping an actor attached to a component after Grab is released (OnDropped), with the caveat that it should be able to be Detached by Grabbing at a later time.

The end goal is to have wire actors that can be connected and disconnected to a range of different electronics components, each containing the mesh component SM_Socket. (I’m building a DC circuit simulator.)

The other problems I mentioned are just problems I’m having with my own solutions to the original problem.

Finally figured out a solution. Disgustingly simple, really. :man_facepalming:

Posting here in case it helps someone else.

2 Likes

Now, if i could just figure out how to STOP it attaching to any component that doesn’t have the socket name BananaSoc … :thinking:

did u figured it out? I’m trying to achieve something similar, and I’d like the 2 objects to stay attached whatever the mesh you have to grab

Hi, did you solve it? I have a similar problem.