Forum Discussion
vtheyoshi
10 years agoHonored Guest
Movement control with leaning
Hi all, I need help modifying the Player Controller script. I would like to create a game in which you move around the world by leaning forward and backward, much like the game Shadows of Isolation...
vtheyoshi
10 years agoHonored Guest
Thanks for your help! Right now I am getting my initial position in Update () right before the call to UpdateMovement() around line 179:
Then, around line 300 at the end of UpdateMovement(), I am trying to alter MovementThrottle when the player holds down "L":
I thought it would be MovementThrottle that I should modify because based on the if (moveForward) lines above, it looks like that is what determines movement. I do have initialPosition declared as a private Vector3 at the beginning of the script.
This does not allow me to move with leaning. What did I miss?
initialPosition = CameraRig.transform.localPosition;
Then, around line 300 at the end of UpdateMovement(), I am trying to alter MovementThrottle when the player holds down "L":
if (Input.GetKey(KeyCode.L)) {
MoveThrottle = CameraRig.transform.localPosition - initialPosition;
}I thought it would be MovementThrottle that I should modify because based on the if (moveForward) lines above, it looks like that is what determines movement. I do have initialPosition declared as a private Vector3 at the beginning of the script.
This does not allow me to move with leaning. What did I miss?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 month ago
- 3 years ago
- 1 year ago
- 3 months ago