picklesnapper Posted June 24, 2019 Share Posted June 24, 2019 I'm having some issues with using the sample code for teleporting. I'm an absolute beginning with blueprints and i think thats mainly the cause. That said, can anyone comfirm they have it working with controller follow using the controllers and *not* gaze? (tag added by moderator) Link to comment Share on other sites More sharing options...
Tony PH Lin Posted June 25, 2019 Share Posted June 25, 2019 Hi , Thanks for your feedback, and this symptom is a bug. We have fixed it and will be included in next release (coming the end of July). Link to comment Share on other sites More sharing options...
picklesnapper Posted June 25, 2019 Author Share Posted June 25, 2019 Ahh gotcha, Thanks for the quick reply! Link to comment Share on other sites More sharing options...
1128 Posted July 3, 2019 Share Posted July 3, 2019 step 1 - WaveVR and ControllerLoader prefab make child of empty gameobject then create script and attach to this empty gameobject. public class TeleportScript : MonoBehaviour { public static TeleportScript instance; public static TeleportScript Instance { get { if (instance == null) { instance = new TeleportScript(); } return instance; } } private Transform sourceCam; //public Transform targtPos; private SampleScript sample; // Start is called before the first frame update void Start() { sourceCam = this.transform; ControllerRay._teleport += TeleportParam; } public void TeleportParam(Vector3 target) { Vector3 pos = new Vector3( target.x, sourceCam.position.y, target.z); //Interop.WVR_InAppRecenter(WVR_RecenterType.WVR_RecenterType_YawAndPosition); sourceCam.position = pos; sample.display.text += sourceCam.position.ToString(); } } step 2 -- make "ControllerPrefab" to public in "WaveVR_ControllerLoader" script. then i have created ControllerRay script and attached it to controller i.e dominant public class ControllerRay : MonoBehaviour { public delegate void TeleportAction(Vector3 t); public static event TeleportAction _teleport; private WaveVR_ControllerLoader controller_right; public GameObject sphere; private SampleScript sample; // Start is called before the first frame update void Start() { controller_right = GetComponent<WaveVR_ControllerLoader>(); sample = FindObjectOfType<SampleScript>(); } // Update is called once per frame void Update() { RaycastHit hit; Vector3 c_pos = controller_right.GetComponent<WaveVR_ControllerLoader>().ControllerPrefab.transform.position; Vector3 direction = controller_right.GetComponent<WaveVR_ControllerLoader>().ControllerPrefab.transform.forward; Debug.DrawRay(c_pos, direction, Color.red); if (Physics.Raycast(c_pos, direction, out hit)) { if (hit.collider.tag.Equals("Ground")) { bool isClicked = WaveVR_Controller.Input(WVR_DeviceType.WVR_DeviceType_Controller_Right).GetPressDown(WVR_InputId.WVR_InputId_Alias1_Trigger); if (isClicked) { sample.display.text = "condition checked"; _teleport(hit.point); } } } } } step 3 - add plane in the scene and tag it as "Ground" Link to comment Share on other sites More sharing options...
picklesnapper Posted July 5, 2019 Author Share Posted July 5, 2019 Thanks for this, i'll give it a test run this week! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.