How can I call OnCollisionEnter?,

I want to use OncollisionEnter()'s "this.transform.position"in Update().


you cannot call OnCollsionEnter() function by yourself, it is a callback by unity physics engine which is being called whenever a gameobject collides with other objects. To be able to use OnCollisionEnter(collision other) function you must attach Rigidbody and Collider to the same object on which this script is attached.