-1

I tried to implement this effect, similar to this: https://www.reddit.com/r/Unity3D/comments/12kn33e/i_added_camera_tilt_based_on_the_movement_of_the/, using Lerp to smooth out the camera tilts, but was only able to get it working "snappily", ie. without lerp.

How could I get an effect similar to the one on reddit?

2

2 Answers 2

0

Hard to answer since I have no code, but usually smoothness is achieved by increasing your camera tilt over time, until it reaches the maximum tilt value.

Here's an abstract example of how to do that:

currentTilt += Time.deltaTime * maximumTilt * 2;

Try using it somewhere in your code, may work. If it doesn't - edit your question and add some of your code so I have more info on your issue.

Sign up to request clarification or add additional context in comments.

Comments

0

As others have posted you should really post what code you've tried, as per site rules.

The effect you're looking for is probably provided by Vector3.SmoothDamp: https://docs.unity3d.com/ScriptReference/Vector3.SmoothDamp.html

Use it to smooth out both the position and rotation (using Quaterion.Euler).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.