vibrating jumps and collisions
Hello, I'm creating a platformer in a 3d space with 2d sprites for the characters. So far I have gotten ground movement perfectly, but jumping is an issue. The sprite vibrates at the apex of the jump instead of slowing down and reversing direction which I'd like to fix as it looks bad and the sprite will also vibrate if you walk into a wall. I'm using box colliders on both the walls and the character and a 3d rigid body on the sprite as well. Here is my code if you need it.`// To move a sprite in a 3d environment #pragma strict
var rightSpeed = 7; var leftSpeed = -7; var jumpSpeed = 7;
function Start () {
}
function Update () { %|-623684698_2|% { transform.Translate(Vector3.right Time.deltaTime leftSpeed, Space.World); } if (Input.GetKey (KeyCode.D)) { transform.Translate(Vector3.right Time.deltaTime rightSpeed, Space.World); } if (Input.GetKey (KeyCode.W)) { transform.Translate(Vector3.up Time.deltaTime jumpSpeed, Space.World); }
}`