Forum Discussion
Futuristichub
10 years agoHonored Guest
Harrier Jet Scripting Problem
Hey everyone! I've almost got my project controls complete! I need one more thing. I can't seem to get my script to allow my vehicle in the air to thrust forward and then backwards in Zero Gravity. Th...
Futuristichub
10 years agoHonored Guest
"FuturisticHub" wrote:"ronczarnik" wrote:
Try transform.forward instead of Vector3.forward. Vector3.forward is a global direction, transform.forward is the localized direction.
Thanks! I actually did try this and since my vehicle is in "zero G" it doesn't work well and act like Zero G. I can turn and pitch just fine but thrust forward and back in Zero G is a no go. :/
This code keeps me on the Z axis no matter what. The Vehicle won't go forward :/
if(Input.GetKey(KeyCode.W)) {
transform.forward += transform.forward * Time.deltaTime * movementSpeed;
}
else if(Input.GetKey(KeyCode.S)) {
transform.forward -= transform.forward * Time.deltaTime * movementSpeed;
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
- 5 months ago
- 10 months ago
- 9 months ago