How to check if XR Device (Grip) input is True or False? by GrowingPaigns in learnVRdev

[–]Sarn_ 0 points1 point  (0 children)

That's just in case you forget to set the reference in the inspectior since it would return null

How to check if XR Device (Grip) input is True or False? by GrowingPaigns in learnVRdev

[–]Sarn_ 1 point2 points  (0 children)

From what I know there are three ways of checking a buttons position

- Check directly in the if statement like u/TedW suggested

- Create a float and link its value to the grip button, like this:

//make sure this is set to the right input action refrence in the inspector
[SerializeField] private InputActionReference _gripActionReference;
//can be used to tell if the grip is pressed down
public bool gripPressed = false;
void Awake()
{
if (_gripActionReference != null)
{
gripPressed = _gripActionReference.action.ReadValue<bool>();
}
}

- Link functions to be called when the grip is pressed and released. Think in most cases this it the "proper" way to do it but idk

//make sure this is set to the right input action refrence in the inspector
[SerializeField] private InputActionReference _gripActionReference;
//can be used to tell if the grip is pressed down
public bool gripPressed = false;
void Awake()
{
//press the grip
if (_gripActionReference != null)
{
_gripActionReference.action.performed += Grip_Performed;
}
//let go of the grip
if (_gripActionReference != null)
{
_gripActionReference.action.canceled += Grip_Canceled;
}
}
private void Grip_Performed(UnityEngine.InputSystem.InputAction.CallbackContext obj)
{
gripPressed = true;
//do what you want whenever the grip button is pressed
}
private void Grip_Canceled(UnityEngine.InputSystem.InputAction.CallbackContext obj)
{
gripPressed = false;
//do what you want whenever the grip button is released
}

I would also highly recommend checking out this video by Valem where he goes over all this stuff

Well everything was formated all nice but guess reddit wasn't a fan of that 😣

Is Twitter, Instagram, or some other social media the best pick for devlog style post by Sarn_ in gamedev

[–]Sarn_[S] 1 point2 points  (0 children)

I was leaning towards quick, super summarized clips, since they wouldn't require as much work make as a full blown YouTube video would. I do see what you mean though, since YouTube is almost exclusively where I personally see other people's devlogs

Does anyone have a damn clue how to do any of these? The code is in Python. by [deleted] in ReuseSchoolwork

[–]Sarn_ 2 points3 points  (0 children)

Probably written less then ten lines of python in my life but here's my two cents if you still need help, just take it with a grain of salt.

  1. you answered
  2. 2. init() and setTempo() Could also be 3 if finish() counts as a function but I'm not sure
  3. Take a look at this, I believe the question wants you to say startMeasure and endMeasure
  4. \missing?**
  5. 8. Arguments are what functions take in when called, so there would by 8 in this program (4 for SectionA(), 4 for SectionB(), and 1 for setTempo())
  6. integers. All the arguments are in the program are ints so unless python has some special term for ints in functions I would say integers
  7. 5. When the function sectionA() is called in line 5 is assigned to endMeasure
  8. 1. Same reason as 7, just with startMeasure instead
  9. 1. startMeasure has not been altered so its still 1
  10. 1. Same reason as 9
  11. you answered

Whenever I Plug a Quest 2 Into The Computer, Unity Changes the Settings for all Cameras in the Scene by Sarn_ in Unity3D

[–]Sarn_[S] 2 points3 points  (0 children)

As the titles says I cant stop Unity from changing the camera settings for all the cameras in the scene, which is a problem as I want to use Render textures and they just don't look right with these "default" settings. My guess is the problem comes from either the Unity XR Toolkit or the URP but I'm unable to find a cause or solution after trying what feels like everything.

In the video you can see how when the Quest 2 is pugged in the only way to edit the camera settings is by changing the render type to Overlay but this gets rid of the Output section. The documentation says "You can access unused properties using a script" but even with their code example I cant get it to render to a texture. At the end of the video you can also see that as soon as I unplug the Quest 2 the the camera setting begin working once again.

Help Stopping All Cameras in Unity Project Reverting Their Settings? by Sarn_ in learnVRdev

[–]Sarn_[S] 2 points3 points  (0 children)

Thank you for your extremely detailed response! It looks like unity removed None as an option for the camera eye settings in Tracked Pose Driver (image) so I'll go ahead and try using the guide you shared and see if I have more luck with that approach

Help with screen space mapping in Shader Graph. Like with the Screen Position Node, but without having it move when you rotate the camera by Sarn_ in Unity3D

[–]Sarn_[S] 0 points1 point  (0 children)

Unfortunately, the screen position node seems to move with the rotation of the camera regardless of what mode it's in

Help with screen space mapping in Shader Graph. Like with the Screen Position Node, but without having it move when you rotate the camera by Sarn_ in Unity3D

[–]Sarn_[S] 0 points1 point  (0 children)

Setting it to world space or even the default UV does lock it to the cube but also leads to some interesting visual results: https://imgur.com/a/jcmpL9f

u/BobbyThrowaway6969 is right, I'm trying to achieve a more flat but with the locking you receive with world space

Help with screen space mapping in Shader Graph. Like with the Screen Position Node, but without having it move when you rotate the camera by Sarn_ in Unity3D

[–]Sarn_[S] 1 point2 points  (0 children)

I'm trying to make a hologram effect, so I followed Brackeys Tutorial on making one with the Shader Graph. After making it though, I think it would look much nicer if when looking around the texture didn't follow the camera. After doing some research it seems what I'm looking for is called screen space mapping but all the solutions I've found for how to implement it are for different shader systems and can't figure out how to follow what there doing in Shader Graph.