Quantcast
Channel: Latest Questions by RoboticSarcasm
Viewing all articles
Browse latest Browse all 40

How do i smoothen this movement?

$
0
0
I've made a 2D movement script but when i jump it is very jittery once the gravity kicks in and you're still pressing W. Does anybody know how to smoothen it a bit? using UnityEngine; using System.Collections; public class Player : MonoBehaviour{ public float moveSpeed = 10f; void Update () { float h = Input.GetAxis("Horizontal") * Time.deltaTime * moveSpeed; float v = Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed; transform.Translate (new Vector3 (h, v, 0)); } }

Viewing all articles
Browse latest Browse all 40


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