Search Unity

Question VR in game joystick help please

Discussion in 'Visual Scripting' started by Caspertom82, Oct 2, 2023.

  1. Caspertom82

    Caspertom82

    Joined:
    Apr 27, 2016
    Posts:
    11
    HI, I have what is probably an easy task for most that I'm just having a heck of a time with. I wanted to start a claw/Crain game in VR. I made a joystick object and constrained its movement and rotation except for its X and Z rotation and I can grab that with the XR interaction and move it around as expected .

    Now I would like to get values from that rotation(the joystick object) and make a 2ed object move along its X and Z . I built a graph that kind of works (pictured) that gets the Angle from the stick and transforms it to the 2ed objects position but the issue is since the joystick starts at 0,0,0 .... on play the 2ed object jumps to the worlds 0,0,0 and starts from there. I think I need to have the 2ed object move on its own x,y,z and not the worlds X,Y,Z but not sure how to do that.

    if you know how to fix this or even better a proper way of doing this task ,please let me know. Thank you Screenshot (7).png
     
  2. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    398
  3. Caspertom82

    Caspertom82

    Joined:
    Apr 27, 2016
    Posts:
    11
    Thank you for the info , but i rebuilt it all with local pos and it still would not work after 3 days .. still jumps to worlds 0,0,0 . i got it to work in Unreal so I may just build the game there since its easier to make object A rotation = object b position .. Thank you again
     
  4. Caspertom82

    Caspertom82

    Joined:
    Apr 27, 2016
    Posts:
    11
    I did get this to work using IF statements to change the direction ..so thank you Screenshot (9).png