- Home /
Trying to create a VR Drag movement system, but not much documentation...
As an example I have
Public Transform rightController;
Public XRRig myRig;
Public CharacterController myRigsCC; // will use one or the other
Vector3 gripLocation1;
Vector3 gripLocation2;
With this method I am detecting grip button down, and setting gripLocation1 to = rightController.position (I will place the correct object in inspector to get the transform). I can update once every frame, or I can update on gripButtonUP.
However, getting the distance from Vector3 gripLocation1 and gripLocation2 gives me the distance for the controllers distance (I do not want to jump between the character controller position to grip position so it needs to be grip1 to grip2 positions)
What would be the appropriate way to move the rig or a character controller the distance/direction etc etc of the difference between GripLoc1 & GripLoc2?
I assume that there are methods that are built into Unity that can handle it easily? I wrote my own script for calculating distance of Vector3s, and a few others to only find that they already existed. (good experience I guess). Yet, I do not see (or probably likely dont understand what I see) any built in functions for such a thing.
Also to kind of reiterate my problem, I think my major failing is understanding how to calculate a movement/translation using 1 objects change for another objects change. (Object 1 = Controller.GripButton & then Position at the moment of pressing). (Object 2 = Rig will be moved in realtime on update or after the GripButton has been released).
I have been eyeing this and trying to understand it a bit better: https://docs.unity3d.com/ScriptReference/Vector3.MoveTowards.html
but if I am not mistaken it wouldnt work for this use case.
Your answer
Follow this Question
Related Questions
is it possible to edit the Continuous Move provider (Action based) to add a jump feature? 1 Answer
Swining Arm Locomotion 0 Answers
Grid Based Movement (Pokemon-like) 1 Answer
why ragged ( not smooth) movement....hlp plz 1 Answer
VR: Manipulate Input for Continous Movement Provider // Create "Arm Swing Locomotion" 0 Answers