Player Rotation relitive to active camera

Hello, I’m trying to make a silent hill/RE style game without take controls. I have it to were the player movement axis adjust based on the activeCamera object’s transform. But I’m having trouble getting the rotation of the player graphics to work

Player Movement script:

var moveSpeed : float = 10;
var activeCamera : GameObject;

function Update () 
{
	var vert : float = Input.GetAxis("Vertical");
	var horz : float = Input.GetAxis("Horizontal");
	
	transform.eulerAngles.z = 0;
	transform.eulerAngles.x = 0;
	
	rigidbody.AddForce(activeCamera.transform.right*horz*moveSpeed);
	rigidbody.AddForce(activeCamera.transform.forward*vert*moveSpeed);
	
	
}

This is what I have so far for the player graphics rotation. I just don’t know where/how to implement the activeCamera’s transform so that when I press down on the joypad the playergraphic rotates relative to it.

var speed : float = 1.0;
var playergraphic : Transform;
var activeCamera : GameObject;

function Update () 
{
	transform.eulerAngles.z = 0;
	transform.eulerAngles.x = 0;
	transform.eulerAngles.y = 0;
	
	MoveRotation();
}

function MoveRotation ()
{
	var vert : float = Input.GetAxis("Vertical");
	var horz : float = Input.GetAxis("Horizontal");
	var moveDirection = new Vector3(horz, 0, vert);
	
	if(moveDirection != Vector3.zero)
	{
		var newRotation = Quaternion.LookRotation(moveDirection);
		playergraphic.transform.rotation = Quaternion.Slerp (playergraphic.transform.rotation, newRotation, Time.deltaTime * speed);
		
	}
	
}

Found the answer in this thread here: unity Answers forum

Tell me if that works, I’m pretty sure this is how the Silent Hill team would do it.
You might need to flip “Quaternion.LookRotation(playergraphic.position - activeCamera.transform.position)” to “Quaternion.LookRotation(activeCamera.transform.position - playergraphic.position)”, if the direction is backwards.

var speed : float = 1.0;
var playergraphic : Transform;
var activeCamera : GameObject;
 
function Update () 
{
    //Slerps the rotation of the camera to point at the player via a calculated direction
    activeCamera.transform.rotation = Quaternion.Slerp (activeCamera.transform.rotation, Quaternion.LookRotation(playergraphic.position - activeCamera.transform.position), Time.deltaTime * speed);
}