Jump to content

Search the Community

Showing results for tags 'xbox'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. GamePad / Input System

    Hi, I’ve setup a project to use the Xbox controller for player controls. I’ve done this using the ControlsXPad360 class to get the controller input and the set the control states for the player based on the game pad input like so: int leftThumbstickX = (int)gamepad.getLeftX(); if (gamepad.getLeftX() > 0.25) leftThumbstickX = 1; else if (gamepad.getLeftX() < -0.25) leftThumbstickX = -1; else leftThumbstickX = 0; if (App.get().getKeyState(ControlsApp.get().getStateKey(Controls.STATE_MOVE_RIGHT)) == 0 && leftThumbstickX >= 0.1f) { controlsRef.setState(Controls.STATE_MOVE_RIGHT, leftThumbstickX); } The problem with this is setState only takes an int so you lose the analogue values and fine movement controls for the player. I’ve started to look at the following information in the documentation: https://developer.unigine.com/en/docs/2.7.1/code/uniginescript/scripts/input Is this the correct way to use the gamepad with a player? I’ve created a short xml to test this but in the Unigine script file that was created when I created the test project when I do Step 4 and add the code to load the xml controls: Control control = new Control(); control.loadFromFile("Input.xml"); and then run the project, the world no longer loads and I get the attached error, without this code it runs fine. Can you advise on the correct way to implement xbox controller controls for a player while maintaining the analogue input? Thanks, Marc.
×
×
  • Create New...