- Home /
look ik with based player rotation ??
i want to look ik like aiming but when play, my player like weird,
this my code :
public Transform m_Target;
public Vector3 m_Offset;
Animator m_Anim;
public Transform m_Chest;
private void Start()
{
m_Anim = GetComponent<Animator>();
m_Offset = m_Chest.localEulerAngles;
}
private void LateUpdate()
{
m_Chest.LookAt(m_Target.position);
m_Chest.rotation = m_Chest.rotation * Quaternion.Euler(m_Offset);
}
12.png
(48.1 kB)
Comment
You need to be more precise. What do you not like about this? You could use Lookat only with the head. You could also try switching both elements of the multiplication in LateUpdate.
Your answer
Follow this Question
Related Questions
Player rotates with camera(face same direction as the camera) 1 Answer
rotate on the Y axis 1 Answer
LookAt on one axis 2 Answers
Simple Script Problem 1 Answer