Search Unity

Rewired - Advanced Input for Unity

Discussion in 'Assets and Asset Store' started by guavaman, Sep 25, 2014.

  1. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    I don't provide links to bug reports because Unity's system then links to all other reports you've ever made from that email address. In addition, these reports include email addresses and other personal information that I do not want exposed to the public / bots to harvest.

    I received this response on 11/30/2017:

    I will do testing to see how many and which of these bugs are no longer present on the various platforms. I would consider it still experimental / beta if these major breaking bugs still exist regardless of what the label of the feature is in the editor.
     
  2. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Sorry for the late reply on this. I tracked down what was causing it though, I accidentally set the default and inverted color scheme settings to the same color. So it only appeared as if it was having no effect.
     
  3. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Thanks for clearing that up. Glad you got it working.
     
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    It means that your code is throwing an exception. Code that is executed in the OnControllerEvent method is throwing an exception.

    The method you are using to check whether the controller is a joystick is not correct. You are blending Unity's input system with Rewired's, and there is no reason to do that.

    This is how you should check if the device is a joystick:

    Code (csharp):
    1.  
    2. private void OnControllerEvent(ControllerStatusChangedEventArgs args)
    3. {
    4.     if(args.controllerType == ControllerType.Joystick) Debug.Log("This is a joystick!");
    5. }
     
  5. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47
    I resolved, thanks.
    Another problem: If I try to create a mouse mapping, I check this exception in the editor (and of course the mouse does not work)
    MissingMethodException: Rewired.UnityUnifiedMouseSource.GetHardwareElementType Due to: Attempted to access a missing member.
     
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    That exception makes no sense at all and should never happen. I cannot imagine any way possible you could get this exception under any circumstance. It's saying a method in a class in the DLL is missing. The DLL would never have compiled were this the case.
    1. Is this in the editor?
    2. If not, what platform are you building to?
    3. Are you using the IL2CPP scripting backend (which performs method stripping)?
    4. What version of Rewired are you using?
     
  7. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47
    1 yes, is in editor.
    3 no
    4 I am using 1.1.3
     
  8. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Hi, Rewired is picking up background inputs even though I have the option disabled.
    I'm on Windows 10 64bit. Unity 2018.1. Build with IL2CPP enabled, although it happens in the editor too
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    1. What version of Rewired?
    2. Keyboard, Mouse, or Joystick?
    3. Full-screen or windowed?
    I cannot reproduce this. Make sure the Rewired Input Manager is in sync in all scenes you are testing/building. If you have made a prefab, the in-scene instance may be out of sync with the prefab parent which would cause it to have different settings. This is a very common issue when building.

    Check the value at runtime using ReInput.configuration.ignoreInputIfAppNotInFocus.
     
    Last edited: Jun 6, 2018
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Well, there's no way this exception should ever be possible. I cannot explain it. It's definitely not a code bug. I can only assume some kind of corruption of the DLL on your system. Update to the current version of Rewired and see if it continues.

    See Updating Rewired before updating.

    Edit: Is your build platform set to Nintendo Switch?
     
    Last edited: Jun 6, 2018
  11. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    1. Rewired 1.1.14.3
    2. Keyboard, have not tested controller
    3. Fullscreen, but the non exclusive one. I think its technically borderless window?
     
  12. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    I don't see how this could be possible.

    Rewired checks whether input is allowed every frame before processing any input.

    When the application is not in focus:
    1. If "Ignore Input if Application is not in Focus" is set to True, input is not allowed.
    2. If the application is set to full-screen as reported by Unity, input is not allowed.
    3. In the editor, keyboard input is never allowed if the game window is not focused regardless of the "Ignore Input if Application is not in Focus" setting.
    Focus is checked with the MonoBehaviour.OnApplicationFocus callback.

    There's no code path that could result in what you are seeing, either in the editor or in a build. Indeed, I cannot reproduce it.

    Therefore, I can only guess it is one of the following causing it:
    1. As mentioned above, the scene you're building may have out of sync data in the Rewired Input Manager. Check the value at runtime using ReInput.configuration.ignoreInputIfAppNotInFocus.
    2. You are not actually getting this input from Rewired but from some other input source such as UnityEngine.Input.

    To further diagnose this, please try the following two files.

    Build:
    https://www.dropbox.com/s/u78gipji0fp91ff/RewiredFocusTest.zip?dl=0

    Unitypackage with the test script and scene: (You will need Rewired installed to build the package).
    https://www.dropbox.com/s/g7qt5enw557polm/RewiredFocusTest.unitypackage?dl=0

    Press X and it will make a beep sound. When the application is not focused, you should not hear the beep sound when X is pressed.
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    @Amalfi-Prozen Thinking about this issue more and looking through the code, it would be possible for this exception to be thrown if Rewired_Core.dll is not from the same Rewired version as the Rewired_Editor.dll and that Rewired_Core.dll is from an older version of Rewired that didn't have the method it's looking for. There must be some kind of corruption / modification to Rewired that has taken place in your project. You may even have multiple copies of Rewired or the Rewired_Core.dll or Rewired_Editor.dll in your project which could cause this because it might be using an older Rewired_Core.dll and a newer Rewired_Editor.dll. Follow these instructions to delete Rewired entirely and reinstall it: Doing a clean install of Rewired. Delete any duplicate copies of Rewired or the DLLs in your project.
     
    Last edited: Jun 6, 2018
  14. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Sorry for wasting your time, I restarted Unity and it seems to be working now :/ Either I incorrectly reported it, or something had just gone weird with unity (maybe it was hogging focus) anyways sorry for that but thank you!
     
  15. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    Ah, the old "turn it off and on again" fix. Always worth a try :)
     
    QFSW likes this.
  16. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    I'm glad it's working now.

    If this does happen, the only possible vector would be MonoBehaviour.OnApplicationFocus not firing when the application loses focus. I've never seen this occur, but it's possible.
     
  17. JorisDormans

    JorisDormans

    Joined:
    Oct 13, 2017
    Posts:
    4
    Hey there, I must be missing something quite obvious...
    I am using Rewired 1.1.7.8.U2017, and I am getting some weird behavior.
    First of all, it seems Rewired is having trouble registering multiple button/keys at the same time. For example, holding down a direction key on the keyboard (WASD) blocks most other ButtonDown events from being registered.
    But it gets weirder. When I use two XBox 360 controllers (controlin two different players) they seem to block each other! Only one player can move using the left stick at a time...
    I am reading the input events inside the Update Loop, and its only the Update loop checked in the settings. Any help would be much appreciated. Thanks
     
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    1) That is a very old version of Rewired released on 10/15/2017. I can't support a version of Rewired that old. It's impossible for me to keep track of all the changes that have been made since then.

    2) Neither of those behaviors has ever been seen or reported, so it has to be something in A) your Rewired Editor setup or B) your code (or both).

    Use the information on the Troubleshooting page to determine what is wrong and why:
    http://guavaman.com/projects/rewired/docs/Troubleshooting.html#debug-information

    Holding a key down would never block other ButtonDown events. This is the only thing that I can think of that could be the cause -- Keyboard Ghosting.

    Based on both of these statements, the most logical guess is that you are not registering for input events properly and/or not processing these events properly. Please show me your code for both.
     
  19. JorisDormans

    JorisDormans

    Joined:
    Oct 13, 2017
    Posts:
    4
    I don't think that's the case as it is only two buttons at same time in this case. But as I said it is very likely I miss something obvious.


    Not sure what you mean with registering for input events (that might very well be the thing that I was missing)
    But the script that's responsible for handling input simply gets a reference to the relevant player

    Code (CSharp):
    1. player = ReInput.players.GetPlayer(playerIndex - 1);
    To pass on the move input to the relevant script I simply do

    Code (CSharp):
    1. movement.walking.x = player.GetAxis("MoveHorizontal");
    2. movement.walking.z = player.GetAxis("MoveVertical");
    ANd to read a button I do:

    Code (CSharp):
    1. if (player.GetButtonDown("InventoryPreset1"))
    2.                     inventory.RecallPreset(0);
    The last two snippets are called from void Update().

    There are very few other calls I make...
     
  20. JorisDormans

    JorisDormans

    Joined:
    Oct 13, 2017
    Posts:
    4
    Addition: if I look at the debug information I can see the axis for the left-stick change value. But the game character does not respond...
     
  21. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    It's not what you're missing. I read your message where you said "I am reading the input events inside the Update Loop" and assumed you were using the event method to get input. You're using the polling method which is entirely different and simpler.

    I don't see anything in the code that would explain it.

    What value are you looking at here?

    Debug Information -> Controllers - Shows mid-level Controller information.
    Debug Information -> Players -> Actions - Shows values of Actions in Players.

    The 2nd would be more important to check first because this would indicate a mapping problem. When you move the left stick, do you see the value of "MoveHorizontal" change in the Debug Information for that Player? Do you see the values being blocked in your keyboard case?

    But you should also check whether the Joysticks are assigned to your Players as you think they are.

    You can also check what Controller Maps are loaded in each Player and see what Actions are mapping to.

    Finally, if Debug Information shows all the values properly as expected, then I would say the problem is in your processing code, not in getting input.
     
  22. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47

    thanks I solved, I have another problem, how do I understand via rewired if my pc is connected to a pad xbox or ps4? Thanks for your answer!
     
  23. JorisDormans

    JorisDormans

    Joined:
    Oct 13, 2017
    Posts:
    4
    So I upgraded to the latest version 1.1.14.4 but the problem persists.

    When I look at the debug info for the player actions all looks good but when I trace the polled data directly the polled data doesn't change as expected. They are simply not the same...

    I was simply using:
    Code (CSharp):
    1.  movement.walking.x = player.GetAxis("MoveHorizontal");
    2. movement.walking.z = player.GetAxis("MoveVertical");
    3. if (playerIndex == 2)
    4.       Debug.Log("Player 2 walking raw: " + movement.walking);
    So to clarify, the Axis don't register any change for player 2 when player 1 is also using that axis. (So the player will keep moving in the same direction as long as player 1 is moving to).

    Thanks for taking the time to help me with this issue
     
  24. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I am guessing because you are using X-input.


    From the Rewired documentation ...

    https://guavaman.com/projects/rewired/docs/KnownIssues.html#xinput-device-name

    On Windows, with Use XInput enabled, and always on Windows App Store and Windows 10 Universal builds, there's no way to differentiate one XInput controller type from another. To XInput, everything is simply Gamepad with an id of 0-3. This is not a Rewired issue, it is a design decision by Microsoft.
     
  25. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    @JorisDormans You can also p
    Please clarify your question. I cannot tell if you are asking how to tell what type of controller is being used (Xbox one controller, PS4 controller, etc.) or if you are asking how to tell if any gamepad is plugged in or if you are asking about the Xbox One and PS4 platforms.
     
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    This is just not possible. Debug information uses the exact same Player.GetAxis functions that you are using. If Debug Information's Actions are showing things correct and your code is logging different results directly from Player.GetAxis, you are not calling the code with the same arguments. The only possible differences could be the player id and the Action name.

    I've created the attached testing tool. Install it in your project, then add the RewiredActionTest prefab to your scene. It contains a Canvas and a script that will display on-screen the results player.GetAxis on all Actions. You can see the values from up to 5 Players at the same time on the screen so you will be able to see if anything is being blocked as you report. Please tell me the results of this test.

    If the test shows everything works correctly, please send me your entire script and a copy of your Rewired Input Manager. (If it's just an in-scene object, send the scene. If it's a prefab, send the prefab parent asset file and the scene. Or if it's small enough, you can send your whole project.) You can send me this via PM or contact me on the support form.
     

    Attached Files:

  27. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Looking for help or advice. Not sure if this really is a Rewired issue, but I'm hoping the asset might be able to help.

    I have an Android mobileVR game that uses gamepad input. Works great with Rewired.

    The problem I have is in my main menu scene.
    As the scene starts I set the FirstSelected UI element in the Event System, using:
    Code (CSharp):
    1. EventSystem.current.firstSelectedGameObject = startButtonGameObject;
    All works fine. Other buttons in the interface are then selected by using up/down/left/right

    The problem I have is that if a player touches their phone's screen (i.e. a Touch Input is registered) the UI buttons then become deselected. I can't work out where 'focus' goes. Pressing up/down/left/right on the controller no longer has any effect, as no UI button is selected there's no 'active' button and nowhere for the selection highlight to go, and of course pressing the submit button does nothing. (other buttons not mapped to a UI action, like application quit, still work fine)

    So I'm wondering what I can do to stop this happening. Does Rewired have a way to completely disable Touch Input? I looked in the documentation but all I can see is information about the Touch Controller - which I don't have in the scene.
    I only have the Rewired Standalone Input Module, with 'Allow Mouse Input' and ' Allow Mouse Input If Touch Supported' both disabled (unticked).

    Any advice, ideas or other workarounds would be very much appreciated.
     
  28. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Like you guessed, this is not a Rewired issue. This is a Unity UI issue. Rewired does not change the way Unity UI works. The RewiredStandaloneInputModule simply re-routes input from UnityEngine.Input to Rewired. Everything else functions as Unity designed it. The behavior you describe is exactly what happens when using the standard StandaloneInputModule provided by Unity.

    EventSystem.current.currentSelectableGameObject is set to null when the user touches or clicks anywhere on the screen off of a Selectable GameObject. If you want to force some GameObject to be selected at all times, you have to manually set the selected GameObject when none is selected using EventSystem.current.SetSelectedGameObject.

    Rewired does not handle touch input. Rewired comes with touch controls which are on-screen touch UI elements for use as joysticks, buttons, etc. Rewired does not read touch screen data natively on any platform. All touch input is coming from Unity through their UnityEngine.Input system. Rewired cannot disable features of UnityEngine.Input. The touch input code used in the RewiredStandaloneInputModule is copied and pasted from the StandaloneInputModule source code and uses UnityEngine.Input for all touch data.

    If there were a way to disable touch input in the UI only, it would appear as a toggle in the RewiredStandaloneInputModule. This is not a feature of the RewiredStandaloneInputModule, as it is not a feature of the StandaloneInputModule on which it is based. Unity also allows touch input to simulate mouse input, which would make the UI respond to touch even if Rewired were to try to disable it by skipping the touch input code in the RewiredStandaloneInputModule unless the user also disabled UnityEngine.Input.simulateMouseWithTouches, which would be inappropriate for the RewiredStandaloneInputModule to do because it would affect everything else that relies on mouse input in the project.
     
    jeromeWork likes this.
  29. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Thanks, A super helpful response, as always.

    It's as I thought, I'll have to find a clever way to detect when no UI element is selected, without continually polling for a selected GameObject.
     
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    I don't know of any way you could detect this without polling. There's no event in EventSystem to which you can subscribe to which will tell you when the active selected GameObject changes.
     
  31. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Seeing as how Unity 2018 cycle introduces IL2CPP for standalone platforms I'll have to ask: will we get Rewired properly working with IL2CPP builds on PC?
     
  32. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    If you tried building to Standalone IL2CPP in Rewired, you will see this message displayed in the console:

    There is also documentation on the issue here.

    The issue is extremely complicated from many different directions. As things exist, it's simply not possible for IL2CPP to build the Windows library because IL2CPP does not support the required IL instructions to do so. (Unity has confirmed this.) The only solution is to convert the entire Windows library to non-.Net C++ which is a huge task.
     
  33. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Well, I really do hope that it will be figured out. Thanks!
     
  34. Tresch

    Tresch

    Joined:
    Sep 28, 2014
    Posts:
    2
    I'm having some trouble with the Rewired Standalone Input Module I think. I simply cannot get it to respond to any keyboard inputs. I've followed the setup for the Control Mapper a few times through, and just don't get response.

    In order to eliminate variables, I set up a new project and created a simple canvas with a couple buttons, that, on submit, change the color of another canvas elements. With the built-in unity event system, I'm able to use the arrow keys to change which button I'm focused on, and hit the submit button (default enter) to submit and watch the panel color change.

    Then, when I remove the unity Event System object and replace it with the default Rewired Event System, and set up my controls UIVertical, UIHorizontal, UISubmit, and UICancel in the input manager, I can't get the UI to respond at all.

    The input manager is working, as I'm polling some of my actions within other scripts in the project using other actions and mappings, and everything seems to be okay, but I can't get the Event System stuff to respond at all, even with the Control Mapper

    I'm using unity 2018.1.3f1
     
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    It sounds like you just haven't setup keyboard input correctly. It's most likely a Keyboard Map / assignment problem:
    http://guavaman.com/projects/rewired/docs/Troubleshooting.html#keyboard-problems

    Super useful tool to see where your problem is:
    http://guavaman.com/projects/rewired/docs/Troubleshooting.html#debug-information

    If you don't have the Keyboard Map loaded in your Player that contains these UI Actions, you'll get no input. You can easily see this using Debug Information.

    In addition:
    1. Check that the Rewired Player id set set correctly in the RewiredStandaloneInputModule.
    2. Check that you have a default GameObject selected in your EventSystem.
    3. See this important note.
     
    Tresch likes this.
  36. Tresch

    Tresch

    Joined:
    Sep 28, 2014
    Posts:
    2
    Ah hah! Initial problem was that I had moved my UI controls to a separate map category, and hadn't assigned that to a player. In my test project, I forgot to do the player assignments. Sorry, been awhile since I've used rewired, a lot of steps to keep track of! Thanks so much for the quick response!
     
  37. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    Is it possible to get rewired working in the editor?
     
  38. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    If you mean when you are not in Play mode, no.
     
  39. ahmed_decoy

    ahmed_decoy

    Joined:
    May 19, 2013
    Posts:
    58
    Hey @guavaman ,

    Anything special I have to do for PS4 Dualshock 4 on the PS4? Currently deploying our game to multi-platforms (PS4, Xbox One, Windows, OSX). PS4 seems to be the only one not recognizing the controller. Here's a peak at my set up. The default dual analog is the only map I have defined, maybe I have to do a specific map for Dualshock 4? Let me know if I'm doing anything funky, or if you have any quick suggestions. If not I'll do some further investigation and get back to you.

    upload_2018-6-12_7-32-26.png

    upload_2018-6-12_7-35-22.png

    upload_2018-6-12_7-36-15.png
     
  40. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Will Rewired support 4 motor vibrations on on Xbox One controller with Win10 non-UWP apps in the future (through Windows.Gaming.Input)? It's technically possible to do this without UWP: https://stackoverflow.com/questions...e-windows-gaming-input-in-c-without-using-uwp (you can also dynamically link to the runtime so you'll not create something that runs only on win10).

    Alternatively, are Rewired native code sources available for people who've bought the asset?
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    No. You do not have to do anything special.

    I have never received another report of PS4 controllers not working on the PS4, therefore I suggest you verify what is really happening using the information in the Troubleshooting page:
    http://guavaman.com/projects/rewired/docs/Troubleshooting.html#debug-information

    Possible vectors:
    • Joystick recognition
    • Joystick assignment to Player
    • Controller Map assignment to Player
    Only when you know which of these is causing your input to not work can you move on to figure out why.
     
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    I was not aware or this possibility, but I don't have any plans of changing this at present due to several factors:
    • Rewired for Windows is written in C# in .Net 3.5. The Windows.Gaming.Input library is not likely to be compatible.
    • The only way to use the classes in C# without a reference to the library would be through reflection which is slow and incurs garbage collection penalties.
    • When using Unity's IL2CPP scripting backend, you canot load C# libraries dynamically.
    • The only way this could be done is to replace the current Windows library with a C++ library.
    • Windows.Gaming.Input would not be compatible with XInput as they'd be handling the same devices. XInput would have to be disabled and Windows.Gaming.Input used instead.
    • Windows.Gaming.Input.Gamepad has some nasty side effects because Microsoft maintains internal controller bindings which make certain devices such as the Dual Shock 4 appear as Windows.Gaming.Input.Gamepad devices. When also supporting HID devices, you have the same device showing up twice, once through each method . Until a recent Windows 10 SDK version, there was no way through the API to tell if a device was also showing up through Windows.Gaming.Input.Gamepad making it impossible to reliably filter out the double devices. To use the new version of the API to tell which devices are HID and which are Windows.Gaming.Input.Gamepad requires also replacing all current HID device handling with the Windows.Gaming.Input.RawGameController API.

    No. Rewired's source code is not available.
     
    Last edited: Jun 12, 2018
  43. max00007

    max00007

    Joined:
    Feb 13, 2016
    Posts:
    19
    Hello,

    moved Question here and: just started with the trial version and to make a long story short: Just what I was looking for and I´m gonna buy it for sure once a little problem is solved. I hop someone can help,

    I want to switch everything controller related to Rewired, Now I have a lot of prototypes (FPS, cars, planes, boats etc.)
    and I have some problems connecting those to Rerwired. I guess a little tutorial (i could not find) would be very helpfull: How to I connect Rewired to the standard unity FPS? Meaning how to controll the standard FPS with a gamepad configured with rewired? As an example I guess this would help me with the others. Or do I have to rewrite every movement script?

    Thanks & Cheers
     
  44. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Have you read the Rewired quick start already?
    http://guavaman.com/projects/rewired/docs/QuickStart.html

    From the Rewired documentation this is info on converting scripts
    http://guavaman.com/projects/rewired/docs/HowTos.html#converting-scripts

    I think it is easier to change everything over to Rewired not just controllers. This might be a good overview ... it is just a simple POV camera example.

    https://forum.unity.com/threads/can...ship-or-aircraft-cockpit.455223/#post-2957041

    Here is how I modified RFPS asset to work with Rewired .. basically following the converting scripts idea from Rewired documentation.

    https://forum.unity.com/threads/realistic-fps-prefab-released.176985/page-69#post-2921727
     
    Last edited: Jun 13, 2018
    guavaman likes this.
  45. max00007

    max00007

    Joined:
    Feb 13, 2016
    Posts:
    19
    Jup read the Quick start; that did not work so well. But the other 2 hints really help a lot. Didn´t the "converting" part in the documentation. That worked for a quick prototype. Going to further test tonight, but maybe it is a good idea to change everything over. Thanks
     
  46. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I think converting everything over would make it much easier.

    Just guessing you are targeting a Desktop windows environment? You did not state what you are working on.

    Once you have the Rewired actions defined it works pretty nicely.

    The POV camera is simple example showing how the Rewired actions work with keyboard, gamepads, HOTAS (flight controllers) and a specific Racing wheel. It does not matter what input I am using as long as I have mapped it to the actions.

    The reason I like Rewired is I can mix and match everything controller wise. I can use Racing wheel and pedals with FPS. I can also use Flight Controllers and a keyboard with the same FPS. I did quite a bit of unconventional controllers with Realistic FPS (RFPS) and it was fun.
     
  47. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    As @longroadhwy pointed out, the documentation shows how to convert existing scripts to Rewired. If your game is 1-Player, using UnityInputOverride would be the fastest way.
     
  48. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello Guavaman,

    I am interested in buying this asset, but I have some concerns. I am currently working on a game for 3 platforms: IOS, Android, and Xbox One, so I thought it would be awesome to be able to use the same input code for the 3 of them, and this assets seems to be able to do just that.

    I watched your video about the way your asset works which is great and honestly looks quite simple! My concern though is about the mobile input. You touch very briefly in the video about custom inputs, but honestly I think I would need a more in depth kind of tutorial about how to apply this asset for mobile platforms.

    Is there any good tutorial or documentation about implementing mobile solution with your asset? Please let me know.

    Regards,
    Carlos
     
  49. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    It depends entirely on what type of input you mean. Mobile platforms are capable of joystick, mouse, keyboard, touch (various forms), and accelerometer input.

    Rewired does not handle any kind of swipe/gesture controls. If you want to use those in the Rewired Player-Action system, you'd have to implement them as a Custom Controller.

    Touch Controls:
    Bundled on-screen touch joysticks, buttons, touchpad, and a simple rotational control. Use these or use any from the asset store (or build your own) by using a Custom Controller.

    Examples come with Rewired for various things including Touch Controls and Custom Controllers. Download the trial and look at them to understand how they work.
     
    Last edited: Jun 13, 2018
  50. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Guavaman,

    I just downloaded the trial version to see what is possible.

    Regards,
    Carlos