playMaker

Author Topic: Input System Actions (Git Install)  (Read 19463 times)

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #30 on: April 28, 2021, 11:18:09 PM »
I have updated this package to a git install. You can install now using the package manager and this address: https://gitlab.com/toomasio/playmakerinputsystemactions.git
Hey Digitom, I got everything working... thanks for this! How am I able to get the input from the joystick? I tired using 'Input System Read Vector2 Value' and assigned a vector2 variable, but it's not working. Is there another Action I should use? Thanks!

Hello. I have not fully tested this for XR input use, but I am pretty sure the new Input System just spits out either a Float Value, Vector2 Value, or Button(bool) value from the action input. One of these should work if the action asset is set up properly. I also noticed you have an Index of of range error. Might be a good idea to open up the console to see if this is interfearing with other logic.
So I gave this another shot, the buttons work but the joystick Vector2 is not being read. I'm not getting any more errors so everything should be working. Would you mind double-checking your code for the 'Input System Read Vector2 Value' Action? Maybe it's not being read every frame or something. Or if you have another Action I could try, let me know. Thanks!


Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #31 on: April 29, 2021, 09:20:09 AM »
I have updated this package to a git install. You can install now using the package manager and this address: https://gitlab.com/toomasio/playmakerinputsystemactions.git
Hey Digitom, I got everything working... thanks for this! How am I able to get the input from the joystick? I tired using 'Input System Read Vector2 Value' and assigned a vector2 variable, but it's not working. Is there another Action I should use? Thanks!

Hello. I have not fully tested this for XR input use, but I am pretty sure the new Input System just spits out either a Float Value, Vector2 Value, or Button(bool) value from the action input. One of these should work if the action asset is set up properly. I also noticed you have an Index of of range error. Might be a good idea to open up the console to see if this is interfearing with other logic.
So I gave this another shot, the buttons work but the joystick Vector2 is not being read. I'm not getting any more errors so everything should be working. Would you mind double-checking your code for the 'Input System Read Vector2 Value' Action? Maybe it's not being read every frame or something. Or if you have another Action I could try, let me know. Thanks!

yeah the vector2 read value action works every frame on my end. There might be some extra setup needed for XR to get the joysticks to work inside the input system. You can run tests using a normal gamepad or keyboard as well to make sure your input actions are set up properly for vector2 output. Then you will know if its the action asset or the XR input. Unfortunately I do not have an XR system setup so I can not help you further than what is presented here.

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #32 on: April 29, 2021, 10:23:36 AM »
Thanks. I am able to get the keyboard to work now. I made a new Input Action set, so maybe there's something that is causing issues within the XR Input sample.

Another question, when I press the W key, I get a 1 in the Y like it should within the Vector2. Is there a way to reset that to 0 when I unpress the W key?

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #33 on: April 29, 2021, 03:49:02 PM »
Thanks. I am able to get the keyboard to work now. I made a new Input Action set, so maybe there's something that is causing issues within the XR Input sample.

Another question, when I press the W key, I get a 1 in the Y like it should within the Vector2. Is there a way to reset that to 0 when I unpress the W key?

I updated the package so it does not use event handlers anymore. It just uses simple read methods from the input assets in the OnUpdate method. You will need to check "every frame" now when reading values. Also added the option to bypass the player input if needed, but you will need to make sure you enable the action before using it (using the Enable Action)...or it wont work. Hope this helps!

read inital post for update instructions.

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #34 on: April 29, 2021, 10:19:45 PM »
Thanks. I am able to get the keyboard to work now. I made a new Input Action set, so maybe there's something that is causing issues within the XR Input sample.

Another question, when I press the W key, I get a 1 in the Y like it should within the Vector2. Is there a way to reset that to 0 when I unpress the W key?

I updated the package so it does not use event handlers anymore. It just uses simple read methods from the input assets in the OnUpdate method. You will need to check "every frame" now when reading values. Also added the option to bypass the player input if needed, but you will need to make sure you enable the action before using it (using the Enable Action)...or it wont work. Hope this helps!

read inital post for update instructions.

Thanks for the update. So it sort of works. When I initially play the scene, it does not grab the values. When I press the Trigger and leave the State then go back to it, it pulls the X and Y value for about a 1/2 second then stops working. A second later it zeros them out again until I leave the State and go back. Thoughts?

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #35 on: April 30, 2021, 08:13:48 AM »
Thanks. I am able to get the keyboard to work now. I made a new Input Action set, so maybe there's something that is causing issues within the XR Input sample.

Another question, when I press the W key, I get a 1 in the Y like it should within the Vector2. Is there a way to reset that to 0 when I unpress the W key?

I updated the package so it does not use event handlers anymore. It just uses simple read methods from the input assets in the OnUpdate method. You will need to check "every frame" now when reading values. Also added the option to bypass the player input if needed, but you will need to make sure you enable the action before using it (using the Enable Action)...or it wont work. Hope this helps!

read inital post for update instructions.

Thanks for the update. So it sort of works. When I initially play the scene, it does not grab the values. When I press the Trigger and leave the State then go back to it, it pulls the X and Y value for about a 1/2 second then stops working. A second later it zeros them out again until I leave the State and go back. Thoughts?

I would just constantly read the X,Y values in a separate FSM so it does not get interrupted with the trigger logic. Also make sure you Enable the action. Another thing you might have to do is change the action type of your action to "Pass-Through" in the asset file. I created a similar scenario where I leave a state, come back, and everything seems to be working on my end. Do a test with non-XR inputs to see if you get the same results.

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #36 on: April 30, 2021, 10:23:28 AM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #37 on: April 30, 2021, 11:55:23 AM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Yes you need to create a variable or else you can't use that data anywhere else. If you are not using PlayerInput as the source, you will need to Enable the action to use it. PlayerInput component automatically enables the actions for you if you use it as the source. In most scenarios you will just use the PlayerInput component for ease of use, but I added an option to not use it just in case people wanted more fine control.

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #38 on: April 30, 2021, 12:09:14 PM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Yes you need to create a variable or else you can't use that data anywhere else. If you are not using PlayerInput as the source, you will need to Enable the action to use it. PlayerInput component automatically enables the actions for you if you use it as the source. In most scenarios you will just use the PlayerInput component for ease of use, but I added an option to not use it just in case people wanted more fine control.

Sounds good, thanks.

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #39 on: April 30, 2021, 02:36:23 PM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Yes you need to create a variable or else you can't use that data anywhere else. If you are not using PlayerInput as the source, you will need to Enable the action to use it. PlayerInput component automatically enables the actions for you if you use it as the source. In most scenarios you will just use the PlayerInput component for ease of use, but I added an option to not use it just in case people wanted more fine control.
Is there an action in which I can get the Vector3 of a controller for example?

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #40 on: April 30, 2021, 04:11:09 PM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Yes you need to create a variable or else you can't use that data anywhere else. If you are not using PlayerInput as the source, you will need to Enable the action to use it. PlayerInput component automatically enables the actions for you if you use it as the source. In most scenarios you will just use the PlayerInput component for ease of use, but I added an option to not use it just in case people wanted more fine control.
Is there an action in which I can get the Vector3 of a controller for example?

This is more of a basic PlayMaker question. I would ask this somewhere else. If you run into any other issues with this plugin as again here. Thanks.

example of controller movement:

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #41 on: May 03, 2021, 09:32:36 PM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Yes you need to create a variable or else you can't use that data anywhere else. If you are not using PlayerInput as the source, you will need to Enable the action to use it. PlayerInput component automatically enables the actions for you if you use it as the source. In most scenarios you will just use the PlayerInput component for ease of use, but I added an option to not use it just in case people wanted more fine control.
Is there an action in which I can get the Vector3 of a controller for example?

This is more of a basic PlayMaker question. I would ask this somewhere else. If you run into any other issues with this plugin as again here. Thanks.

example of controller movement:
Hi, what I mean is that I would like to get the Vector3 of a VR controllers position and rotation in local space. Similar to your 'Input System Read Vector2 Value', but a read Vector3 for both position and rotation, ideally separately. I think that's the last piece of the XR puzzle. :)  I appreciate your help!



Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #42 on: May 03, 2021, 09:45:29 PM »
I got it working now with using a keyboard. I'll have to check the joystick later tonight when I get home form work. So it looks like it doesnt show in the "Store Value" unless you create a variable. I thought it would populate the X and Y in the 'Input System Read Vecor2 Value'.

Any what did you mean by "make sure you enable the action"? I thought if the FSM is on the game object it should work.

Thanks again for all your help!

Yes you need to create a variable or else you can't use that data anywhere else. If you are not using PlayerInput as the source, you will need to Enable the action to use it. PlayerInput component automatically enables the actions for you if you use it as the source. In most scenarios you will just use the PlayerInput component for ease of use, but I added an option to not use it just in case people wanted more fine control.
Is there an action in which I can get the Vector3 of a controller for example?

This is more of a basic PlayMaker question. I would ask this somewhere else. If you run into any other issues with this plugin as again here. Thanks.

example of controller movement:
Hi, what I mean is that I would like to get the Vector3 of a VR controllers position and rotation in local space. Similar to your 'Input System Read Vector2 Value', but a read Vector3 for both position and rotation, ideally separately. I think that's the last piece of the XR puzzle. :)  I appreciate your help!

Ah I see. I added Vector3 and Quaternion to the new update. Hope it works!

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Input System Actions (Git Install)
« Reply #43 on: May 03, 2021, 10:15:26 PM »
I see. I added Vector3 and Quaternion to the new update. Hope it works!

You're fast! Well it's not pulling in the Vector3's. Do you think a Late Update would help? I know the controllers position and rotation is working since I have the XR Controller script active. If you look at the right part of the screenshot you'll see that the Input Actions are correct (XR Controller).

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Input System Actions (Git Install)
« Reply #44 on: May 04, 2021, 10:02:55 AM »
I see. I added Vector3 and Quaternion to the new update. Hope it works!

You're fast! Well it's not pulling in the Vector3's. Do you think a Late Update would help? I know the controllers position and rotation is working since I have the XR Controller script active. If you look at the right part of the screenshot you'll see that the Input Actions are correct (XR Controller).

Yeah not sure what is going on there. If there are any errors that pop up in the console let me know. I am simply Reading Vector3 output from the action...if the input is vector3 it should be spitting out that value.