- Home /
Question by
FusionSausage · Nov 29, 2013 at 06:01 PM ·
2dmovementcharacter
Unity 4.3 2D make character not so blurry when moved
Hi, I'm trying out the new 2D system in Unity, which is amazing. I just have a quick question, when I move my character with my move script
using UnityEngine;
using System.Collections;
public class CharacterBehaviour : MonoBehaviour {
public bool jump = false; // Condition for whether the player should jump.
public float moveForce = 365f; // Amount of force added to move the player left and right.
public float maxSpeed = 500f; // The fastest the player can travel in the x axis.
public float jumpForce = 1000f; // Amount of force added when the player jumps.
public Transform target;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.D)) {
target.transform.Translate(Vector2.right * maxSpeed * Time.deltaTime, Space.World);
}
if (Input.GetKey(KeyCode.A)) {
target.transform.Translate(-Vector2.right * maxSpeed * Time.deltaTime, Space.World);
}
if(Input.GetButtonDown("Jump")) // && grounded
jump = true;
}
void FixedUpdate () {
if(jump)
{
// Add a vertical force to the player.
rigidbody2D.AddForce(new Vector2(0f, jumpForce));
// Make sure the player can't jump again until the jump conditions from Update are satisfied.
jump = false;
}
}
}
it becomes very "blurry". Is there a way I can tweak this to make the moving "sharp"? It might be my computer, but it sometimes stutters as well. Thanks!
Comment
What do you mean by blurry? Can you show an example video or screenshot? The 2D Sample project has really good movement scripts.
Your answer
Follow this Question
Related Questions
making an object move to a certain point 3 Answers
GetKey and GetKeyDown are always registered? [Answered] 2 Answers
Another Double Jump Question 0 Answers