Sorry for my poor English.
Already, I have to move freely in the virtual keyboard players.
I’m locked on in “transform.LookAt(enemy);”, Targetting…
var enemy : Transform ;
function FixedUpdate () {
transform.LookAt(enemy);
In this state, I want to detect if the player is moved to the left or right, or has moved to either.
However, as the image is an overhead view.
The reason for this is if you move to the left, because you want to assign in the “mecanim” individual animations that are walking to the left.
How do you do it can be detected?
.
I is likely to be used to go etc., “Vector3.Dot” try a few times,
I’m not sure.
(in the)
function FixedUpdate () {
newpos = thisTransform.forward;
var Dot = Vector3.Dot(newpos,prevpos);
Debug.Log("Dot =" + Dot);
prevpos = thisTransform.forward;