Moving an object with a collider in 2d?

Warning: big noob here.
Can anynoe tell me why following doesn’t work?

function OnTriggerEnter2D(other: Collider2D) {

What I want to have happend is to move the object which the object with this script is colliding with.
Can anyone help me?

If you are talking about getting it to compile, then yea. Collider is a class. If you are trying to move the ‘other’ object, then it should be:


If you are trying to move the object this script is attached to: