I’m trying to set up some flight controls for a spaceship. Basically I’m trying to duplicate the way the Vipers move in the new Battlestar Galactica series.
I’m using the Linear and Angular Velocity values for “thruster” movements (rotation and translation of the craft), but when I try to use Linear velocity for the main engine (which should only accelerate the craft), it doesn’t work as expected for anything but the initial heading the craft is in when I start the game.
Yup, though that’s honestly how it behaves, as if it’s stuck in the global instead of the local orientation. Double and triplechecked to make sure I had L set.
Okay, I’ve got the flight controls working more or less the way I want, and now I’m trying to figure out something else.
How do I make it so I set a particular Linear Velocity with a keypress, and then with that same keypress set the Linear Velocity to 0 (turning on and off a main engine).
The easiest way is to use properties. The logic is as follows:
If key “w” is pressed, increase “go” by 1. (go=0 by default)
If “go” = 1, apply thrust.
If “go” = 2, “go” = 0 (so it goes back to off and will toggle).
Hm, still working on the on/off functionality, just have to get the syntax right I think. Much thanks to both of you!
My next question is weapons. I’m looking at Social’s FPS template, and one I don’t understand much of it, and two, from what I do understand, it seems to be an instant-hit projectile, is this correct? I’d like to make projectiles with a fixed velocity, and I’m not entirely sure how. The addObject actuator seems to have sometimes random results. Searches have revealed little though I would think this would be a popular topic.
If I wanted to assign the y value specifically to a variable, for example.
Alternately, is there a way to make an object roll faster and faster the longer you hold down a key, so that you can tap it for a minor movement and hold it for faster movement?
Okay I’ve gotten help before from y’all, so I’ll keep asking my questions. If I’m not being specific enough or there’s something causing my questions to be ignored, please by all means tell me.
I’m trying to make it so that if you tap the w a s d keys you get a slight correction in that direction. If you hold them down though it’ll roll or pitch the vehicle using a faster speed.
The print statements are there to see what’s going on, I haven’t been able to make “above” return a value of 1 however, though the “below” one seems to.