How to fire physics thruster momentarily? (button press)

From what I can gather, you simply add a physics thruster component in the viewport, then set its strength, and you could even set auto activate which will play it as soon as the game starts and it is in the world. But I’m wanting a momentary switch or button press to activate the thruster. I saw one video showed using set active nodes to do it but I think there must be another way.

You can activate / deactivate the component but setting the strength would also work.

image

Thank you for your response!

It seems to me really hard to control. I’m probably not doing it right. Have read a few comments about you need to try to be sure to get the physics thrusters in the center of mass.

You should be interpolating the vector. If you press the pedal to the metal in a car, it’s somewhat hard to control, too! For something more advanced, look into PID controllers. Vast topic.

But you can make a simplified one with springs:

image

Think of them of like a stability controls so things do not get out of hand. Also, games fake a lot of things because realism is not that much fun. It’s very easy to make a hard game (right?!), so the idea is to help the player by nudging things in the right direction.

We’re not taking this rocket to Mars, are we? Asking because you may want realism.

Wow thanks, I had no idea this node existed. I can see where that would be very useful. I watched a few videos trying to understand it. From what I make of it you take two points, point a and point b, and this creates like a “spring” effect between the two, modifying with variables like stiffness, or how stiff that virtual spring is. I do not understand some of the other variables like spring state.

Right click the pin and promote to variable, and you can forget about it. It holds the current state of the spring - internal data like error correction and so on. You will not be interacting with it.

It seems to me really hard to control.

But perhaps there’s a much simpler solution - depending on what the above means, what the expectation are, and the end goal.

How would I go about making the thruster strength constantly go down while active? That way say you have an array of 5 thrusters set to 10,000 each, Full on 1 would be then I suppose collectively would be 50,000 force, but the thrusters would need a time they are being taken back to zero, an interpolation…

Hmm, maybe an interp to full on quickly as well, but in an asymmetric and very unbalanced way quickly go to zero. (2 to 1, or 3 to 1 ratio or higher) This way the player has to ride the key to get a usable hover. The reason I say an array is because maybe fire them each LESS than 100 percent based on vehicle current pitch and yaw assuming the thrusters are firing straight down to get more usable control then just the fixed array.

You’ve started describing a PID I mentioned above. It’s a glorified (yet somewhat dumb) error correction utility. Perhaps have a look here:

I actually used the above in a couple of prototypes.

This is awesome, thanks!