I’ve got a generic “USE” BP action for the right motion controller in my project. Think of it as a long wand in the player’s hand. I’m trying to figure out how to lock the tip of the wand to an actor in the world temporarily through my “USE” BP action. I already know when the tip is overlapping and have all that working; just need a way to “attach” the tip while the actor is being used.
I’ve tried using a physics constraint, disabling the motion controller, etc., but nothing works as I need it to.
The motion controller component is only designed to render its mesh with the exact pose of the controller. If you want to alter it, you will need to use a separate mesh, for example by attaching another mesh component onto the motion controller component.
That’s how I have it set up. Not showing the generic controller mesh. I have a BP actor that spawns and is automatically grabbed by the right hand. The actor has its own static mesh.
Depending on how you attached the actor to the motion controller, you could use a DetachFromActor node to detach it from the motion controller for the duration of the action, and then reattach it.
Well, the big hurdle here is that the actor that’s in the player’s right hand is attached via the grab component, as though the player grabbed it themselves. I do this by spawning it on top of the RightMotionController and then using the default Grab function to attach it.
Any kind of attach/detach breaks the grabbed object.
What I’d really prefer to work is to be able to attach the end of my “wand” to the world object with something like a physics constraint (no linear, just angular) so as the player moves their right hand around the wand will move, but the end of it is stationary, fixed on the world actor.
One way of doing it would be to set the grab type to custom in the grab component to disable it doing the automatic attachment. Then use the OnGrabbed and OnDropped events in the wand blueprint to implement the kind of attachment you want, either using a physics constraint, or normally attaching it and manually transforming it to point in the right direction.