[Bug] Translating GOs is broken

I haven’t figured out what exactly is going on yet, but there seems to be a bug with sprite flipping and translating transforms.

The first part of the GIF is a prototype running in Unity 5.3.4. Everything works as expected. The second part where the sprite moves all about is the same project running in the preview build.

I’m not using Rigidbody2D. The character controller uses raycasting and transform.Translate to move the sprite.

Did you open the project or did you recreate it? As in, is the level made with new Tile Map?
Currently project compatibility between versions is not supported. Which is one of the reasons for the Experimental Preview, so focus can be on the features itself.
You’ll have to try importing the different parts from your other projects that you want to use.

Both. I encountered the bug first in a completely fresh project that I built from scratch. After I couldn’t figure out what is going on, I tried running an existing project with the preview build to confirm it and the same bug appeared using different scripts and assets.

[Edit]

Here is the script for reference:

using UnityEngine;
using System.Collections;

public class SpriteFlipper : MonoBehaviour
{
    public bool facingRight = true;
    Vector3 savedPosition;
    BoxCollider2D box;

    void Awake()
    {
        box = GetComponent<BoxCollider2D>();
    }

    void Start()
    {
        savedPosition = transform.position;
    }

    void LateUpdate()
    {
        savedPosition = transform.position;
    }

    void OnWillRenderObject()
    {
        savedPosition = transform.position;

        Vector2 perfectPosition = transform.position;
        perfectPosition.x = Mathf.RoundToInt(perfectPosition.x);
        perfectPosition.y = Mathf.RoundToInt(perfectPosition.y);
        //perfectPosition.x = Mathf.FloorToInt(perfectPosition.x);
        //perfectPosition.y = Mathf.FloorToInt(perfectPosition.y);
        transform.position = perfectPosition;
    }

    void OnRenderObject()
    {
        transform.position = savedPosition;
    }

    public void SetDirection(float x)
    {
        if (x > 0 && !facingRight)
            Flip();
        else if (x < 0 && facingRight)
            Flip();
    }

    public void Flip()
    {
        Vector3 oldCenter = box.bounds.center;

        // Do the flip
        Vector3 theScale = transform.localScale;
        theScale.x *= -1;
        transform.localScale = theScale;
        facingRight = !facingRight;

        // Adjust position
        Vector3 newCenter = box.bounds.center;
        transform.Translate(oldCenter - newCenter);
    }
}

I’m adjusting the sprite position after flipping because the GO pivot is not the middle of the bounding box. I have to have it like this to avoid sprite jitters when rendering through a pixel perfect camera.

I currently have a workaround where the sprite is a child GO to the actual logic GO but that is something I wanted to avoid having to do for all the objects in my game.