Quantcast
Channel: Questions in topic: "side scroller"
Viewing all articles
Browse latest Browse all 72

Improve smooth 2d side scroller camera to look more fluent

$
0
0
Hi, I am using a very simple linear interp camera with the key lines being Vector3 newPos = target.position + new Vector3(0, relativeHeigth, -zDistance); transform.position = Vector3.Lerp(transform.position, newPos, Time.deltaTime * dampSpeed); (this is from the camera script of the marble game in [5 Unity game examples: C#][1]). This works beatifully for a slow paced game, but in my case velocities are a bit higher (often rigidbody.velocity.magnitude reaches 20 under normal scalings) and when the game is fast my marble doesn't look sharp but its edges seem to be unsteady. If I change the script to a primitive this.transform.position = new Vector3(target.transform.position.x, this.transform.position.y, this.transform.position.z); then the edges look much sharper (but obviously the smooth following of the camera is gone). Any ideas how in the smooth script the unsteadiness of the edges can be approached? Best, Instability [1]: http://forum.unity3d.com/threads/51017-5-Unity-game-examples-C-scripting-tutorial-for-beginners

Viewing all articles
Browse latest Browse all 72

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>