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
Setting initialPosition in Start() now makes the L key into a forward movement key that does not take the position of the headset into account.
As a result of the amount of lean not influencing movement with L, I can only move forward in the direction I start out facing.
By adjust the magnitude, do you mean that I need to get the absolute value of the difference between the two positions? Using Abs() results in an error.
Alternatively, perhaps I need to get a new initialPosition before I move each time, as you suggested, by using GetKeyDown. Does this need to happen inside the same call where I am subtracting the current position? A separate GetKeyDown(KeyCode.L) call in UpdateMovement() doesn't seem to do the trick, nor does putting the call in Update().
Thanks again for you help. Sorry I need to be walked though this!
As a result of the amount of lean not influencing movement with L, I can only move forward in the direction I start out facing.
By adjust the magnitude, do you mean that I need to get the absolute value of the difference between the two positions? Using Abs() results in an error.
Alternatively, perhaps I need to get a new initialPosition before I move each time, as you suggested, by using GetKeyDown. Does this need to happen inside the same call where I am subtracting the current position? A separate GetKeyDown(KeyCode.L) call in UpdateMovement() doesn't seem to do the trick, nor does putting the call in Update().
Thanks again for you help. Sorry I need to be walked though this!
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