Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jumping with Headset Movement #393

Open
xEvoGx opened this issue Aug 12, 2016 · 5 comments
Open

Jumping with Headset Movement #393

xEvoGx opened this issue Aug 12, 2016 · 5 comments

Comments

@xEvoGx
Copy link

xEvoGx commented Aug 12, 2016

I was playing around with the Climbing/Falling demo and absolutely loved it. The sensation of dropping off the tower is exhilarating, especially when you have to take a moment to remember the height is not real despite being rather unnatural to 'want' to drop off from a great height. 😄

Coupled with practicing Jumping from grabbable surface to grabbable surface, that sensation too feeling great, I was thinking it might be quite cool to have a simple jump mechanic built into the headset that doesn't require actual jumping, nor even a great deal of effort (Threshold parameter). Essentially, if you were to quickly bend your knees and then stand up quickly, you would jump.

Mind you in VR you can easily be standing and crouching regularly in some games, so you'd have to test for the magnitude of change along the Y axis in both directions. Quick down-to-up movements of the HMD would result in a jump. Quick down movements (dodging incoming fire) without the equally quick upward movement would do nothing. You would have to slightly yet quickly crouch down the quickly stand back up to initiate the jump.

All these parameters would be tweakable, such as Jump Window(if you quickly crouch but then don't quickly stand within the window, you'll be considered crouching and won't jump), Required Crouch Depth and both the Required Magnitude of the crouch and the subsequent speed of the standing (perhaps these could be tied to a single magnitude, but I was considering that people may do one more quickly than the other).

Thoughts? Could be a fun addition.

@HyppoNymous
Copy link

HyppoNymous commented Aug 16, 2016

I have been testing on some real VR Game scenario and it didn't feel right as gameplay as you are not walking and jumping naturally, and it could be exhausting quickly for some people.
I thaught about use a button to jump or quickly move up your two hands up ?

@xEvoGx
Copy link
Author

xEvoGx commented Aug 16, 2016

I was playing Solus, and I liked the feeling of the jumping oddly enough. Mind you I'm only asking for the ability to tune it so someone can just bend a little downward, then stand back up. Asking someone to actually jump would be exhausting, but if what I'm describing is exhausting, maybe they shouldn't be in a roomspace game to begin with. Simple crouch with an abrupt standing back up. Magnitude not distance moved.

@xEvoGx
Copy link
Author

xEvoGx commented Aug 16, 2016

...also RIPMotion had a movement system that tracked the movement of the HMD along Y (bobbing) and it worked very well. Same concept arguably...

@HyppoNymous
Copy link

HyppoNymous commented Aug 16, 2016

About making a jumping VR movement , you can do it by moving yourself the "CameraRig" object up and down. Or instantiate a physic object wich you add a vertical force and use it as jumping reference movement that you will use to move the "CameraRig" up and down.

Add below script to the object "Camera (eye)" , so you'll got some relative Y speed height of your VR helmet and you could trigger a jump movement when the Y velocity reached some trigger value.

public class CameraHeight : MonoBehaviour {


    private Vector3 FrameVelocity = new Vector3 (0, 0, 0); 
    private Vector3 PrevPosition = new Vector3 (0, 0, 0);  

    private Vector3 PositionYOnly = new Vector3 (0, 0, 0); 

    public void Update() {
        //Reset X,Z to 0 to only calculate Y realtive velocity
        PositionYOnly = transform.position; 
        PositionYOnly.x = 0;
        PositionYOnly.z = 0; 

        // Keep an average velocity due to fixed update irregularity, else we will occassionally get 0 velocity
        Vector3 currFrameVelocity = (PositionYOnly - PrevPosition) / Time.deltaTime;
        FrameVelocity = Vector3.Lerp(FrameVelocity, currFrameVelocity, 0.1f);
        PrevPosition = PositionYOnly;

        Debug.logger.Log (FrameVelocity); 
    }


}

@xEvoGx
Copy link
Author

xEvoGx commented Aug 16, 2016

Time to PR that bad boy Hyppo! Sweet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
VRTK
  
To do
Development

No branches or pull requests

3 participants