- Home /
Question by
ReginTheSmith · Mar 16, 2021 at 10:31 PM ·
3daiagent
ML Agent Moving But Not Rotating
hi, so I followed this tutorial by code monkey: https://www.youtube.com/watch?v=zPFU30tbyKs&t=2419s but the problem is that the agent doesn't rotate when he moves can any one help? here's the code:
public override void OnActionReceived(ActionBuffers actions)
{
float moveX = actions.ContinuousActions[0];
float moveZ = actions.ContinuousActions[1];
float moveSpeed = 3;
transform.localPosition += new Vector3(moveX, 0, moveZ) * Time.deltaTime * moveSpeed;
}
so is there a way I can rotate the agent using the moveX and moveZ? I already tried this:
transform.LookAt(new Vector3(moveX, 0, moveZ));
Comment
Your answer
Follow this Question
Related Questions
AIThirdPersonController help 0 Answers
Can Drone captured point clouds be used as part of a simulation environment to train AI Agents? 0 Answers
AI line/field of sight with Raycast 0 Answers
Nav Mesh Agent break between Rotation changes 1 Answer
How can i do a Very basic enemy AI or chase system? Unity 5 1 Answer