Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

VR GEAR and PHOTON NETWORK

Discussion in 'AR/VR (XR) Discussion' started by fabian1986, Aug 12, 2015.

  1. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    Hi everyBody,


    I created my raycast for when you look you active objects and descriptions......

    The problem Need appear inside a Texmesh a button for this:

    foreach (RoomInfo sala in PhotonNetwork.GetRoomList()){
    TextMesh t = Room1.GetComponent<TextMesh>() ;
    string maxJugadores = sala.playerCount+ "/" +sala.maxPlayers;
    t.text="sala: "+sala.name+"jugadores:"+ maxJugadores;

    GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
    //GameObject myGameObject = new GameObject("Test Object"); // Make a new GO.
    Rigidbody gameObjectsRigidBody = cube.AddComponent<Rigidbody>(); // Add the rigidbody.
    gameObjectsRigidBody.mass = 0; // Set the GO's mass to 5 via the Rigidbody.
    gameObjectsRigidBody.useGravity=false;
    //Collision col = cube.AddComponent<Collision>();

    BoxCollider _bc = (BoxCollider)cube.gameObject.AddComponent(typeof(BoxCollider));
    _bc.center = Vector3.zero;
    //cube.addComponent('collision', { type: 'box', halfExtents: new pc.Vec3(sx * 0.5, sy * 0.5, sz * 0.5) });
    // cube.addComponent('rigidbody', { type: 'dynamic', mass: 1.0, enabled: true, restitution: 1.0 });
    //cube.transform.position = new Vector3(0, 0.5F, 0);

    //casi funcionando
    GUI.Label (new Rect (100, 250+(cntSalas*30), 200, 30),sala.name);
    GUI.Label (new Rect (400, 250+(cntSalas*30), 200, 30)," "+maxJugadores);
    if (GUI.Button (new Rect (600, 250+(cntSalas*30), 160, 30), "Entrada sala")) {
    PhotonNetwork.JoinRoom(sala.name);

    }
    //casi funcionando

    cntSalas++;
    }

    Because I need a list of the rooms in this salas have this atributes:
    sala,name+sala.Playescount and the button.


    OnGUI all good in PC but with my VR GEAR with a S6 EDGE can not use this menu.
     

    Attached Files:

  2. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    and other in English:
    I chage the letters
     

    Attached Files:

  3. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    cube.transform.position = Vector3 (0, 0,5, 0);

    How to use this numbers in the Vector3??¿
     
  4. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
  5. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    I tri but I don't know if a created well the cube "Button" with the colider and parameters
     
  6. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    cube.transform.position = Vector3 ( 230.74,103.98,-434.05); csharp doesn't work

    in js works well transform.position=Vector3(-2.57,7.24,-32.89);
     
  7. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    cube.transform.position= new Vector3 (230.74,103.98,-434.05);
     
  8. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    Why I can't not use double here?¿
     
  9. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    I',m thiking the same but with cube and text mesh
     
  10. Qwertyuiop1234

    Qwertyuiop1234

    Joined:
    Jul 21, 2015
    Posts:
    10
    You need to specify those numbers as floats:
    Code (CSharp):
    1. cube.transform.position = new Vector3 (230.74f, 103.98f, -434.05f);
     
  11. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    ok. thanks triying because I can't create the cube if I has not created before the cube
     
  12. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    foreach (RoomInfo sala in PhotonNetwork.GetRoomList()){
    TextMesh t = Room1.GetComponent<TextMesh>() ;


    Debug.Log(sala.name);

    // I'm thinking with this sentences create a cube for every room read but I don't know If I need created a cube in unity for this.I'm thinking create a room dinamics not static
    // Quiero crear un cubo para cada sala
    GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);

    cube.transform.position = new Vector3 (230.74f, 103.98f, -434.05f);

    //I'm thinking create rigidbody for this cube
    //El rigidbody sino no lee cuando tocas para el cubito que me tiene.....
    Rigidbody gameObjectsRigidBody = cube.AddComponent<Rigidbody>(); // Add the rigidbody.
    gameObjectsRigidBody.mass = 0; // Set the GO's mass to 5 via the Rigidbody.
    gameObjectsRigidBody.useGravity=false;

    //I'm thinking create TEXT MESH para el nombre se sala for the cube
    // nombre de sala por texto para la sala
    TextMesh T= (TextMesh)cube.gameObject.AddComponent(typeof(TextMesh));
    T.text="sala: "+sala.name;

    //I'm thinking create Collider for the cube
    BoxCollider _bc = (BoxCollider)cube.gameObject.AddComponent(typeof(BoxCollider));

    if( _bc.gameObject.Equals(GameObject.Find ("Midisparo").GetComponent<Collider> ().isTrigger = true)){

    PhotonNetwork.JoinRoom(sala.name);

    }

    cntSalas++;
    }

    The cube didn't create a create the static cube yet.

    el cubo no se crea y lo cree para estatico tambien
     
  13. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    close thread I can