Is this possible .....if then How ????

hi,

i am making a simple 2d game in which i require that when the character goes half out the frame from one side the other half side can be seen on the other side. i am trying to explain my point with a image here

alt text
image donwload link

the code i am currently using for this is

if(transform.position.x > 23.49712)
	{
		transform.position.x = -23.49712;
	}
	if(transform.position.x < -23.49712)
	{
		transform.position.x = 23.49712;
	}

i know this code is no solution to the problem but i have no idea how to go about this.

Try this:

void YourUpdate()
{
    float NewX = transform.position.x;
    if (transform.position.x > 23.49712)
    {
        NewX = -23.49712F;
    }
    if (transform.position.x < -23.49712)
    {
        NewX = 23.49712F;
    }
    Vector3 NewTransform = new Vector3(NewX, transform.position.y, transform.position.z);
    transform.position = NewTransform;
}