Forum Discussion
AliHammza
7 years agoHonored Guest
Moving Oculus controller back and forth(along the z axis)
Hey,
I have written a script to pick an object with a rigidbody component by the ray casted from the controller and move it around.
I parent the object to the controller to move it in the scene then. However, I can not move neither the controller nor the object in the forward or backward direction. I can move it up and down or in a circle but I also want to move it along the z axis.
I have written a script to pick an object with a rigidbody component by the ray casted from the controller and move it around.
I parent the object to the controller to move it in the scene then. However, I can not move neither the controller nor the object in the forward or backward direction. I can move it up and down or in a circle but I also want to move it along the z axis.
If anyone could point me in a right direction or help me with this, I would greatly appreciate it!
Thanks in advance.
12 Replies
Replies have been turned off for this discussion
- AnonymousIn Unreal we have access to "RawSensorData" from which you can read acceleration data, I'm sure Unity does also support this.
- AliHammzaHonored GuestHey, could you elaborate a bit please, since I am very new to this.
- AnonymousI am assuming, looking at the tags off your post, you are developing for the Go.
The Go controller does not support '6 degrees of freedom' (6 dof) but is limited to 3 degrees and therefor does not support up/down, left/right, forward/back.I have tried the the 'GetRawSensorData' method (from the Oculus ) reads acceleration data from the device (the controller in this case) which you can use to (sortof) determine the direction in which it was moved.In Unreal this is the signature of the method:
Hope this helps you to find the method in the Unity OVR plugin.void GetRawSensorData(
FVector & AngularAcceleration,
FVector & LinearAcceleration,
FVector & AngularVelocity,
FVector & LinearVelocity,
float & TimeInSeconds
) - AnonymousJust spoke to a Unity guy, he gave me these directions:
And a snippet from within the OVRPlugin:OVRPlugin.GetNodeAcceleration(OVRPlugin.Node.HandRight, OVRPlugin.Step.Render).FromFlippedZVector3f();if (version >= OVRP_1_12_0.version)
return OVRP_1_12_0.ovrp_GetNodePoseState(stepId, nodeId).Acceleration;
if (version >= OVRP_1_8_0.version && stepId == Step.Physics)
return OVRP_1_8_0.ovrp_GetNodeAcceleration2(0, nodeId).Position;
return OVRP_0_1_3.ovrp_GetNodeAcceleration(nodeId).Position; - AliHammzaHonored GuestOhh ok. Thank a lot. The Go controller does not support '6 degrees of freedom' , is there any other way to move object forward/back after parenting it to the controller by pressing the trigger button.
- AnonymousGuess you could do that by pressing the trigger (or measuring the axis value of the trigger?)I have a setup in which I use the trackpad/thumbpad axis value to move the picked up object forward and backward.
- AliHammzaHonored Guesti did that by pressing the trigger, but since the go controller does not move back and forth, therefore I can not move the object in that direction either. It only moves up or down or right or left on a circle.
- AliHammzaHonored Guest
VR-Lab-nl said:
Guess you could do that by pressing the trigger (or measuring the axis value of the trigger?)I have a setup in which I use the trackpad/thumbpad axis value to move the picked up object forward and backward.
Hey, could you please share that setup/script that you used for the movement of the objects along the z axis? - Anonymous
AliHammza said:
i did that by pressing the trigger, but since the go controller does not move back and forth, therefore I can not move the object in that direction either. It only moves up or down or right or left on a circle.
That circular motion is the 3dof in action: you are seeing the registered rotation of the controller.As for the script, this part was done in Unreal's blueprints:'GetUpDown' gives an axis value from -1 to 1 of the position of your thumb on the pad. 'MaxMoveAmount' is how far the object should move forward (or backward) 'StickLocationZero' is the original position of the object. - AliHammzaHonored GuestThis looks very different. I'll try to write a C# script for unity based on this but i'm not sure if it work lol.
Thanks a lot tho
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago