Camera stuff is pretty tricky… you may wish to consider using Cinemachine from the Unity Package Manager.
There’s even a dedicated forum: Unity Engine - Unity Discussions
Otherwise you would need to implement your own filtering on the inputs or movement accumulator variables, perhaps something with SmoothDamp, or else a simple low-pass filter with historic averaging.
Lerping to smooth things out:
Hello and welcome! Aircraft banking is something that always makes me smile.
Here’s some thoughts on the matter. I believe the best way to accomplish what you want is to reorganize your airplane a little bit to have an extra GameObject in its hierarchy that is dedicated only to banking.
If you prefab looks like this:
AirplanePrefab
VisibleAirplaneGeometry
Then revamp it to look like this:
AirplanePrefab
RollPivot
VisibleAirplaneGeometry
Now what you want to do is change the R…
Generally you want a lowpass filter of some kind. Lerp is an easy way to do that and has nothing to do with Quaternions.
Another way to do that is a time-smoothed average. You can get as complicated or as simple as you want with this.
The basic idea is you have an accumulator that is your current input signal.
When taking new input, if you just assign to that accumulator, you will be exactly where you are, no filtering.
If instead you take X fraction of the accumulator and add it to (1 -…
In the case of input smoothing (implementing your own input filtering):
You can use GetAxisRaw and trivially recreate the smoothing of GetAxis on a single axis basis with Mathf.Lerp, or on a dual-axis basis with Vector2.Lerp().
You just need one storage variable and the notion of how snappy you want the smoothing.
float axis; // the "accumulator"
const float Snappiness = 3.0f; // adjust to suit
and then in Update():
// raw input:
float x = Input.GetAxisRaw( "Horizontal");
// smooth it
axis = Mathf.Lerp( axis, x, Snappiness * Time.deltaTime);
// TODO: now use…
Controls are often the hardest thing to get right, especially with touchscreens, which are the most miserable form of control device ever created, apart from Kinect.
Try to identify what you don’t like about the controls.
too sensitive?
too insensitive?
too sensitive in the middle, not sensitive enough at the edges?
too erratic and jumpy?
etc.
All of those problems can generally be fixed with different types of filters. Referencing the above, if rawInput is your raw input,
…