Help With Camera axis

hello I have this script and I would like to know how to implement the rotation of the player so that it is always the one of the camera

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
public FixedJoystick moveJoystick;
public float fuerzaDeSalto = 8f;
public bool puedoSaltar;
public Animator anim;
public AudioSource jumpxd;
public ParticleSystem polvo;
private Rigidbody rb;
private float moveH,moveV,speedMove=22;
void Start()

{
rb = GetComponent();
polvo.Stop();
}

void movePlayer()
{
moveH = moveJoystick.Horizontal;
moveV = moveJoystick.Vertical;
Vector3 dir = new Vector3(moveH,0, moveV);
rb.velocity = new Vector3(moveHspeedMove, rb.velocity.y, moveVspeedMove);

if(dir != Vector3.zero)
{

transform.LookAt(transform.position + dir);
polvo.Play();
}

if(dir != Vector3.zero)
{

}

if(dir != Vector3.zero)
{
anim.SetBool(“Caminar”, true);

}
else
anim.SetBool(“Caminar”, false);

}

void Update()
{
movePlayer();

if (puedoSaltar)
{

if (Input.GetKeyDown(“space”))
{
anim.Play(“Saltar”);

rb.AddForce(new Vector3(0,fuerzaDeSalto,0), ForceMode.Impulse);
jumpxd.Play();

}

}
else
{
EstoyCayendo();

}

}

public void EstoyCayendo()

{

anim.SetBool(“Saltar”, false);

}

public void xd()
{

if (puedoSaltar){
anim.Play(“Saltar”);
rb.AddForce(new Vector3(0,fuerzaDeSalto,0), ForceMode.Impulse);
jumpxd.Play();
polvo.Play();

}
else{

}
}

}

Firstly always use code tags when you post code snippets, Secondly if I get you right, just make the camera a child of a player

does not work, the player when turning back the player does not go to the established direction

Nice wall of completely unreadable text!

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

You may edit your post above.

Camera stuff is pretty tricky… you may wish to consider using Cinemachine from the Unity Package Manager.