Bone script works in Scene window while running, but not in Game window

I have an odd problem, that I hope is just a setting. I have a snake model that turns his head to look at the player, when the player moves along the Z or X axis. The code works perfectly in the scene, but will not run in the game. I can watch the snake head track the player camera in scene, but it’s frozen in game. Here is the code:

 private void LateUpdate()
    {
        lookVector.x = (Player.transform.position.z * 1.5f) - 30;
        lookVector.z = -Player.transform.position.x;
        lookVector.y = 0;

        //lookVector.y = transform.position.y;

        Quaternion rot = Quaternion.Euler(lookVector);
        transform.localRotation = Quaternion.Slerp(transform.rotation, rot, 1);
    }

I put the code in LateUpdate() because I was originally trying to override the animator controller, but that didn’t do anything so I decided to manually manipulate the bone. I’ve also tried this code in regular Update() and same result. The script is directly attached to the Snake’s NeckBone that needs to be rotated.

I even updated Unity to 2019.3.12f1. What would cause the bone script to work perfectly in the scene, but not work at all in game?

Any help is appreciated.

Thank you :slight_smile:

So now, I added the animator back and give him a keyframed animation of flicking his tongue. He now flicks his tongue and follows the player in the scene, but only flicks tongue (no player tracking) in game.

[Tried to attach image]

It started working when I switched platform to PC, so it must be an issue with Android. Going to keep digging.

Solved. Now it’s working in both. If anyone runs into this issue, just switch platforms every time you add a rigged model and need to manually manipulate a bone through script. Works for me. That was half of a day wasted.