Announcement

Collapse
No announcement yet.

Sprint Vector-like momentum on a VR Pawn

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sprint Vector-like momentum on a VR Pawn

    Hello all, I am still getting familiar with every corner of the editor so pardon my ignorance. I have successfully duplicated the arm swinger style movement presented in this tutorial by David Dewhirst,



    These are all the current blueprints driving movement, sorry for the lack of comments. Basically, the distance the motion controllers travel while the button is pressed creates a new vector value that pushes the player in the direction the controller is aiming. Swing your arms and you're moving.

    Click image for larger version

Name:	CheckVRMovement.png
Views:	78
Size:	353.1 KB
ID:	1496769

    Click image for larger version

Name:	CheckControllerDistance.png
Views:	72
Size:	328.8 KB
ID:	1496770
    Click image for larger version

Name:	getvcontrollerdistance.png
Views:	97
Size:	223.6 KB
ID:	1496771

    Click image for larger version

Name:	addplayermovement.png
Views:	78
Size:	92.8 KB
ID:	1496772
    but I would prefer if the character not move as rigid and stop so suddenly as soon as there is no input. Id rather it be a momentum based movement system like Survios' Sprint Vector, where you get started moving and can do other things as the momentum dies down after input stops. How difficult would it be to have inertia take place when the player is moving?

    Thanks for reading.

    #2
    I didn't have time to look into all details of the implementation, but I don't see any array to keep track of past values and average between them nor any vector interpolation, so I understand why the movement starts and stops abruptly. You can simulate some inertia using the two methods I just mentioned. The easiest one is probably a vector interpolation between the displacement vector at the current frame and the same one or two frames back.

    This is what you need to use before applying the displacement to the actor:

    https://api.unrealengine.com/INT/Blu...pTo/index.html

    Give it a try and see if it does what you expect.
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      Thanks for the guidance! Im not sure how to point the VInterp to look at the vector's information on the last one or two frames. I'd really appreciate a simple breakdown of how I can set this node correctly in this context.

      Comment

      Working...
      X