Forum Discussion
Qwonfu
12 years agoHonored Guest
Rotation threshold used for continual player rotation
Hello, I'm trying to develop a control scheme where you rotate your head/Rift outside of a certain threshold, then continual rotation will be applied to the player object until you rotate your head...
dbuck
12 years agoHonored Guest
That could work, but how about something a little more random, bad code, but easier to get rolling to prototype your idea quickly.
Assuming unity..
(On a separate physics layer, you can set them on the objects, and in the Physics preferences menu to not interact with the rest of the scene...)
attach a set of colliders set to trigger that are to the left and right of the player body
have a second collider as a child of the camera controller (On a stick basically sticking out of your face..)
when the face collider enters the left body OnTriggerEnter(), rotate the body 'left' until it hits the OnTriggerExit();
tweak the positions of your 'body' colliders, and the speed of your rotation to suit.
like I said, shit code for optimum performance, but cake to test/play/experiment with to see if your idea works and to play with tweaking the speeds/etc before implementing it nicely.
Assuming unity..
(On a separate physics layer, you can set them on the objects, and in the Physics preferences menu to not interact with the rest of the scene...)
attach a set of colliders set to trigger that are to the left and right of the player body
have a second collider as a child of the camera controller (On a stick basically sticking out of your face..)
when the face collider enters the left body OnTriggerEnter(), rotate the body 'left' until it hits the OnTriggerExit();
tweak the positions of your 'body' colliders, and the speed of your rotation to suit.
like I said, shit code for optimum performance, but cake to test/play/experiment with to see if your idea works and to play with tweaking the speeds/etc before implementing it nicely.
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
- 7 months ago