Problem with moving 2D enemy sprite.

So i want to move my enemy sprite downwards ,

public float speed;

void Start()
{
GetComponent().velocity = transform.forward * speed;
}

i coppied this code from a Unity tutorial, but it was getting Rigidbody and i needed Rigidbody2D so that the only change that i’ve made.

bump

like : transform.down (might be -transform.up) instead of transform.foward? :slight_smile:

Downward would be its Y Axis, so it’s velocity would be going -transform.up. Rigidbody2D will only allow movement in the X and Y Axis (as far as I’ve used it anyways)

transform.up worked.Thanks so much to both of you.

1 Like

no problem, you’re welcome.