Forum Discussion
DannyDan2468
6 years agoProtege
Rotate around scene with Touch Controllers
Is there a solution available for rotating a Scene when using the Local Avatar Prefab in first person view? I want to rotate around the playfield when using both Grip Buttons and the "gesture" known from so many other games.
Danny
1 Reply
Replies have been turned off for this discussion
- DannyDan2468ProtegeI managed to get a little starting point by myself, but this is not turning around the scene object. But the gesture you need to do with the controllers is close to the one known from other games.public class RotateScene : MonoBehaviour
{
public GameObject scene;
public GameObject player;
float speed = 2;
void Update()
{
if (OVRInput.Get(OVRInput.Button.PrimaryHandTrigger) && OVRInput.Get(OVRInput.Button.SecondaryHandTrigger))
{
Vector3 rTouchVelo = OVRInput.GetLocalControllerVelocity(OVRInput.Controller.RTouch);
Vector3 lTouchVelo = OVRInput.GetLocalControllerVelocity(OVRInput.Controller.LTouch);
if (rTouchVelo.z > 0.0f && lTouchVelo.z < 0.0f)
{
player.transform.Rotate(new Vector3(0, -1 * (rTouchVelo.z * (speed)), 0));
}
else if(rTouchVelo.z < 0.0f && lTouchVelo.z > 0.0f)
{
player.transform.Rotate(new Vector3(0, 1 * (lTouchVelo.z * (speed)), 0));
}
}
}
}Maybe someone can point me to the right direction?Danny
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
- 6 months ago