Download

Question with object only moving on X and Y axis while attached to motion controller

Hi, I’ve been trying to tackle the idea lately with me being able to control a computer inside VR but my biggest problem right now is having the mouse translate its position to the 3D widget. So far all I’ve accomplished is using the BP_Pickup_Cube code and modifying it to try and only move the mouse on the X and Y axis. What I’m trying to accomplish is the player to be able to grab the mouse and move it without it lifting off the table and stuff. It just sticks to the table and moves side to side and up and down. I will add clamps to make sure the player doesn’t go off the table and stuff.

I just need some direction on how to go about this. I’ve watched countless tutorials online about how to manually attach the object to the motion controller and then with the Event Tick, update the location based off of the location of the controller and check if its past the max and min X and Y variables. I’m not sure if this is the way to go. I’ve thought about making the mouse a pawn or movable character that my motion controller takes possession of and then while its being grabbed, only move on the 2 axis. But so far not much luck.

Sorry if this was too long of an explanation of my problem, I just wanted to be thorough. I’m open to any recommendations of how to do this!