Basic gamepad support

Plugins Basic gamepad support

Basic gamepad support for VAM. Posted here in case someone is interested.
Background
I have been studying unity for the last week. No prior knowledge but I can program in C++. Two plugins gave me the basics: Keyboard Shortcuts by lfe and MacGruber's Essentials. I got the rest from google. This is the first time I make a plugin, so please this is an early beta.
Coordinates
Local coordinates, even global coordinates becomes a mess with any gamepad configuration I tried after a few moves / rotations, so I had to take another approach. This is what I could come up with: all movements and all rotations are RELATIVE TO THE CAMERA.
For example, if you move an object UP with the left stick, the object will go up on the screen. If you rotate the camera 180 degrees and press UP again, the object will still go up relative to the screen. The main idea is to forget about axes and move stuff with an intuitive approach. This may work, or it may not. I haven't fully tested yet.
Controls
layout.jpg

Below's a few hints to get a better idea about each mode:
1. Position mode (press and release RB)
  • With the left stick you move the selected object around the screen relative to the camera.
  • With the right stick (UP and DOWN) you move the selected object closer and away from the camera.
2. Rotation mode (press and release RT)
  • With the left stick (UP and DOWN) you make the selected object rotate like saying YES pointing to the camera.
  • With the left stick (LEFT and RIGHT) you make the selected object rotate like saying NO pointing to the camera.
  • With the right stick (LEFT and RIGHT) you make the selected object "roll" (like an airplane rolling its wings) relative to the camera.
3. Camera mode (press and release LB)
  • With the left stick you move like any average FPS game. You move the camera forward, backward, left, and right.
  • With the right stick you can freely look around like any FPS game. Up, down, left, and right.
  • With the D-PAD you move the camera up & down and roll the camera to the sides.
How to start
  • Add as session plugin.
  • Open a scene, press SELECT first (to switch to edit mode), press Y (to select a person), press X or A (to select a body part). Switch between RB and RT (move, rotate) and play with the sticks. At any moment switch to LB to adjust the camera.
Final notes
- Camera mode (CAM) is ON by default
- If you get any stick inverted, try running VAM through Steam and configure your controller in there. Otherwise you can edit the source code, adding a minus (-) sign where appropiate.
Have fun!
Author
fabio
Downloads
3,827
Views
15,437
Version
3.0
First release
Last update
Rating
5.00 star(s) 5 ratings

More resources from fabio

Latest updates

  1. Basic gamepad support

    What's new: Local coordinates, custom axes and stick speed!
  2. Basic gamepad support 2.0

    Back into this after some time. Let's go there: What's new: Move and rotate a different object...

Latest reviews

Thank you for this!!
Hope you plans for an advanced version arent' put aside...having possibility to rebind keys and stuff would be mindblowing!!

P.S.
Is me or i don't see any button mapped to normal "click"or something to interact with sliders/buttons?
Upvote 0
useful
Upvote 0
As a total noob, this is a MUST have. The default controls are quite intuitive and makes creating scenes much easier. Thanks for this!
Upvote 0
Very nice. Now, if you add some gui to allow users to map custom axis to the sticks, you'd make a lot of us desktop-only perverts very happy. For example to map two 4-way thumbsticks for left/right hand control.

I see Patreon material with this plugin ;)
F
fabio
That's more or less the plan, an extended version (LT) to control 2 objects at the same time. For each stick you can choose in which of the 3 planes will move or rotate. Thank you guys.
Upvote 0
Thank you.
F
fabio
You are welcome :)
Upvote 0
Back
Top Bottom