Forum Discussion
HD148478
11 years agoHonored Guest
Texture doesn't show up on the Rift
Since I just want a static GUI (no interaction) to pop up whenever I come close to an object, I work with textures.
Here I have this javascript that works well on non-VR projects:
It basically shows or hides the texture when colliding with an invisible cube. Working perfectly on projects that use a normal camera.
What changes should I make so that the Rift displays this texture? I don't understand why it doesn't show up because it's not even a real GUI o.o
Here I have this javascript that works well on non-VR projects:
#pragma strict
private var guiShow : boolean = false;
var riddle : Texture;
function OnTriggerStay (Col : Collider)
{
if(Col.tag == "Player")
{
guiShow = true;
}
}
function OnTriggerExit (Col : Collider)
{
if(Col.tag == "Player")
{
guiShow = false;
}
}
function OnGUI()
{
if(guiShow == true)
{
GUI.DrawTexture(Rect(Screen.width/4, Screen.height/4, 1000,500),riddle);
}
}
It basically shows or hides the texture when colliding with an invisible cube. Working perfectly on projects that use a normal camera.
What changes should I make so that the Rift displays this texture? I don't understand why it doesn't show up because it's not even a real GUI o.o
3 Replies
Replies have been turned off for this discussion
- HD148478Honored GuestI decided to completely give up on coding and went back to playmaker. I set up a gui box in 1 minute, with a normal camera it works, with a VR camera it doesn't. This is annoying. Too much. I've been almost 2 days exclusively trying to solve this :evil:
- MikeFTrusteeI'd recommend using either the new gui system or NGUI. That way you can place any UI object as a worldspace gameobject and not have to deal with the headaches and limitations of OnGUI.
- HD148478Honored GuestThank you. I could finally achieve what I needed after 3 days of struggling and finally switching to playmaker (thank god). But I appreciate your suggestion for NGUI because it will be great to make some things I had planned.
Cheers!
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
- 11 days ago
- 9 months ago
- 4 months ago
- 8 months ago