Move Object OnTriggerEnter?

I cant seem to move an object smoothly on the X axis when the player enters the collider. It just pop into place. I want the object to smoothly translate to the position. The isTrigger is checked, the player is tagged “Player”, and i do have rigidbodies.

    public GameObject chair;
	public float speed;

void OnTriggerEnter(Collider col){

		if(col.gameObject.tag == "Player")
            chair.transform.Translate (new Vector3(8,0,0)* Time.deltaTime);
			//chair.transform.Translate (Vector3.right* speed * Time.deltaTime);

There’s nothing “smooth” in your code… it says “translate 8 units to the right (multiplied by however long it took to process the last frame) the instant something enters the trigger”. Did you mean to use OnTriggerStay rather than OnTriggerEnter?

If not, can you explain what you meant to happen?

Something like that should do it:

void OnTriggerEnter(Collider col){
		col.transform.position = Vector3.MoveTowards (col.transform.position, new Vector3(coordinates you want), Time.deltaTime * smooth);

smooth is a variable (in my game an int).