Demo entry 6799553

X

   

Submitted by Z on May 20, 2019 at 16:26
Language: C#. Code size: 875 Bytes.

void Go()
    {
        if(PlayerInfo.Player.transform.position == transform.position + new Vector3(-2.5f, 0.1f, 2.5f))
        {
            return;
        }
        Vector3 angleA = Vector3.forward;
        Vector3 angleB = transform.position + new Vector3(-2.5f, 0.1f, 2.5f) - PlayerInfo.Player.transform.position;
        if (PlayerInfo.Player.isMove(transform.position + new Vector3(-2.5f, 0.1f, 2.5f)))
        {
            float angle = Vector3.Angle(angleA, angleB);
            if (transform.position.x < PlayerInfo.Player.transform.position.x)
            {
                angle = -angle;
            }
            PlayerInfo.Player.transform.position = transform.position + new Vector3(-2.5f, 0.1f, 2.5f);
            PlayerInfo.Player.transform.eulerAngles = new Vector3(0f, angle, 0f);
            PlayerInfo.Player.Walk_();
        }
    }

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).