0 votes

Hey guys,

For the life of me I cannot figured out 3D flight axis directions. I’m trying to get “W” and “S” to rotate around x axis(pitch) as in take off and land. “A” and “D” to roll as in a barrel roll to inverted flight. And forward down the local -z axis controlled by an increment in throttle(speed) to a set max speed and decrement down to 0. I’m able to get one set but not all sets together. For example, I can get WASD controls to work on local axis by using rotateobjectlocal(transform.basis.x/y/z...). I can make the object fly along local -z axis with input actions increasing/decreasing variable velocity. Velocity as an argument in moveandslide(velocity, Vector3.UP(I’ve even tried transform.basis.y here)). So basically I can get pitch and roll to work together on local axis and I can get movement along local -z axis by itself. but as soon as I put roll, pitch, and movement together or even movement with just one; it just doesn’t work out one or two controls revert back to global axis. I’ve read multiple forums and watched videos and I can’t get anything to work. Sorry for not much code I wrote this on my phone.


in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.