A
A
Antogonistick2021-09-04 17:59:57
2D
Antogonistick, 2021-09-04 17:59:57

How to remove the "trail" behind the character's sprite when moving?

When the character moves, a "tail" appears behind him, but if you greatly reduce the speed, the trail disappears, there is no trail in the animation of the sprites themselves, it appears only in motion. How to make it so that there is no trail when the character moves?

Character movement code:

public float moveSpeed ​​= 5;

public Animator animator;

public Rigidbody2D RB;

vector2 movement;

// Update is called once per frame
void Update()
{
movement.x = Input.GetAxisRaw("Horizontal");
movement.y = Input.GetAxisRaw("Vertical");

animator.SetFloat("Horizontal", movement.x);
animator.SetFloat("Vertical", movement.y);
animator.SetFloat("Speed", movement.magnitude);
}

void FixedUpdate()
{
RB.MovePosition(RB.position + movement * moveSpeed ​​* Time.fixedDeltaTime);
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2021-09-04
@GavriKos

If no trails or other things are hung on the object, then the cable is only from your monitor - i.e. low speed matrix.
According to the code, there are no questions except for the animator. Maybe a train in the animator itself somewhere - look for it.

G
Griboks, 2021-09-04
@Griboks

Apart from other answers, I advise you to also check the shaders and effects of the camera. Maybe it's motion blur or something like that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question