I’ve been trying to get this working for the last…day more or less, and it’s driving me absolutely bananas!
I’ve been following the Unreal video for creating interactions with motion controllers, and it’s partially working. I’m spawning and deleting objects no problem, but I can’t for the life of me get “picking” objects to work. (Such as in the can-toss demo they’re talking about)
I have MotionControllers, which have a collision model of NoCollision
. Each of the controllers has a Collision Sphere around the head of the controller which is set to OverlapAllDynamic
. The Collision Sphere and the Controller Mesh both have Generate Overlap Events
set to true. The hierarchy of these parts looks
I also have a basic Sphere. This is a blank SceneRoot, with a child StaticMesh with
OK, so in my mind that all looks fine. I have created Blueprint Events to handle object overlaps as per the video (for the left controller):
It checks to see if we’re currently holding something, and if not, we set the in-range boolean to true, and set the current “available” object to a reference to the BP_Ball object that we’re intersecting with. If we move out of range, we unset the in range boolean (assuming that we aren’t currently holding something).
Assuming that we are overlapping, we should be able to pull the trigger on the Left controller, and
Now, this is where what i’ve done differs from what’s in the Video. In their video, I think they are somehow passing in a reference to the StaticMesh itself, as their node from Object to the AttachTo target looks like this:
Whereas mine looks like this:
The reason I think this is because later on in the video, you can see that their BP_Ball hierarchy is the same as mine, but they seem to be referencing the name of the StaticMesh:
For reference, my trigger logic
OK, so if I don’t set Simulate Physics
on the Ball, at this point I can spawn a ball in my scene, grab it with the other controller, and when I let go of the trigger it will fall to the ground. Fantastic! Except, once that happens, I can’t grab the ball again. The logic is understanding that i’m intersecting with the ball, and is even firing the AttachTo logic in the pickup as far as I can tell (based on some Print String
nodes i’ve dotted around…), but the ball just will not re-attach visually to the controller.
Likewise, if I set Simulate Physics
from the start, I can’t pick up any ball (although the same logic checks I mention above still fire). It’s like it’s attaching an invisible object to the controller instead of the static mesh!
This whole issue hurting my head. I know i’m close to the solution, but I just can’t get the pieces to fall into place!