ArmSwinger is an artificial VR locomotion library developed on Unity 5.4. ArmSwinger allows you to use your arms to control your position in 3D space in a natural way with minimal disorientation.
First, thanks for this very nice script ! It is very well done !
I would like to make my character fall when he goes off cliff. Right now when the player fall from a platform he is instantly teleported on the ground. I would like to have the natural falling animation. How can it be acheived ??
Hey! I've been looking how to make this kind of movement for the Oculus Rift and the nearest approach I've found is yours. I know you tested this on HTC Vive but I'd like to know if i can use this for Oculus or how can I start to develop the scripts for it. Thank you so much for any help you can give me.
I have an avatar (enemy) with a 10 meters sphere collider set on it (for simulating sighting)
But unfortunately, this prevent the player to get close to the avatar, as ArmSwinger prevent to walk when hitting the sphere collider as it was a wall.
I have disabled all prevent settings but it is always the same behavior.
Is there anyway to make this sphere collider "transparent" for ArmSwinger" ? (by settings / layers or by change the code ?)
I am trying to combine ArmSwinger with NewtonVR and I've found that ArmSwinger finds SteamVR_ControllerManager only when Awake() is change to Start(). There are still some null reference errors, but my first guess is that NewtonVR deactivates some controller objects dynamically.
Does anyone know of any potential problems that this change could introduce?
Players can sometimes see through walls while ArmSwinging into a wall with Push Back mode enabled. Wall Clip Speed Penalty helps with this, but doesn't eliminate it. Push back override also helps.
I suspect the fact that ArmSwinging occurs in Update() and wall clip/push back occurs in FixedUpdate() is the cause here.
I seem to come up with these questions when I'm away from my headset, in Starbucks on my laptop lol...
...does/will your system support being able to crouch under surfaces (hiding under desks, crawling through vents), and if you stand up in said enclosed areas will you be pushed back to the last safe location?
Now that I've had more time to continue working, and of course talking to you about the raycasting I have what I hope isn't asking too much!
What it be possible to have a pure ArmSwinger that is nothing more than simply the movement derived from swinging your arms? Keep the curves and inertia (this is a must!) but completely truncate all the checks, raycasting and all other protections. Essentially (and within the package mind you) you can have Full Arm Swinger script, which is what you have now, and an Arm Swinger Raw/Lite/Pure script that is nothing more than the movement.
Push Back due to Instant Height change or Prevent Wall Clip works great against walls and steep slopes. It does not work as well on overhangs. When you run into the underside of a surface, you'll be pushed back to your previous position. Depending on how you approached the surface, that might still have your headset in the surface.
Need to come up with a better way to handle it. Maybe rewind instead of push back if the surface is pointing downwards.
Positions are currently added to the cache if the player has moved at least rewindMinDistanceChangeToSavePosition world units since the last saved position. However, if the player is moving fast and has moved say 2x that distance, only one position is added to the cache.
The result is that if a player is going fast enough, they can go farther into an out-of-bounds area than if they were going slowly.
Implement a system that accounts for this difference, and consistently rewinds the player at the same point regardless of speed.
Sometimes the whole scene will freeze frame, by freeze I mean the HMD will not update and will be a single non updating frame until you reset the scene.
The easiest way to reproduce the freeze frame is to run full speed into the steps too steep to climb, or into the side or back of a staircase a full speed. It's also easier to reproduce and happens in more places if you crank the max speed up to 10+.
I was just reading a review of Robinson: The Journey and they note a very interesting (and dead simple) technique for reducing movement based nausea. To simplify I'll cut and paste:
"The playerβs movement speed is controlled directly by their viewpoint. When looking directly ahead the player can move at full speed, however this momentum is then reduced when off-centre. For example, if the player looks upwards at 45 degrees their movement speed will be halved; looking at the floor will reduce them to a crawl speed. How does this benefit the player? Simply by reducing the chance of discomfort through unexpected travel: in first-person videogames the player can often move further than expected when not looking at the horizon, which in VR can have disastrous effects. Robinson: The Journey does not suffer from this concern-adding issue."
This sounds like a tremendous addition to ArmSwinger imho!
Currently, safe positions are saved based on the results of the last angle check. It's possible that the last angle check was before the current position, which means we could potentially be saving unsafe positions.
The easy move here is to make the two min distances identical, and get rid of the latestCenterChangeAngle and latestSideChangeAngle kludges.
Currently, the moving and stopping inertia curves are forced to linear. This is so that we can determine where in the curve the calculation should start based on the last speed. Custom curves should be supported.
I'm currently have jumping/falling with physics which work fine, but with Arm Swinger added, I have unexpected instantaneous movement to the ground, and I'm uncomfortable gutting the code for fear of breaking what works beautifully in Arm Swinger.
Big Picture: The ideal setup would be to allow us to only keep what we need/want so we can hopefully use AS in conjunction with other scripts. In my case, I only need the swing-movement of course, and the wall clipping prevention methods, while I can work around slopes and terrain height adjustments easily, so I don't need climb/fall prevention or any checking/adjustments along Y.
I forgot to mention this yesterday, but it would be nice if you required the player to move the controller a certain minimum distance before moving, at least if starting from a complete stop.
Right now I can simply 'waggle' the controller and begin moving...far from swinging arms. That being said, I can see where this could possibly be a problem, as I understand your system requires constant movement (outside of inertia...then again that might be sufficient).
At the very least it's worth a see, and it would be nice not to jostle when I waggle π
I found a bug on stairs.
If you run off the side of the stairs fast at an angle just right you can get stuck in a constant fade-to-black rewind loop. It seems easier to reproduce with walking and stopping inertia on and turned up, but I managed to get it to happen even with both inertia settings off.
It gets you completely stuck and only resetting the scene seems to fix it. I can't even manually walk in meat space to get out of the loop.
I was able to trigger it on both the ramp collision and regular collision stairs, and even on the staircase in the FPS Scene.