Can't transform Game Object.

void Update()
{
if (CheckSunlightCamera.Instance.IsCatchingSunlight())
{
ResetPlayerPosition();
}
}

void ResetPlayerPosition()
{
    playerTransform.position = new Vector3(0f, 1f, 0f);
}

So, this is a piece of code that goes at the bottom of code that i’m using to detect whether a player is in sunlight or not. I have a ‘playerTransform’ Serialization up at the beginning, and this code works with every gameObject under my Player gameObject, but not the Player gameObject itself. I’m feeling like there’s been some small oversight, but I can’t figure it out at all.
I hope that makes sense. Thank you for reading!

@ruadh21

I’m not sure, but it seems to me that the problem is with the sunlight check and not with the player’s drive - you can try adding Debug.Log("check"); above the player’s drive and check if it appears in the console.

Hope I was clear and helped something.