Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //xdist is the distance between the center of the camera and the player. xvel_ is the player's x velocity, xpeed_ is the absolute value of xvel_
- xGo = xDist != 0f ? xDist / Mathf.Abs(xDist) : 0f;
- Debug.Log(follow.transform.position.x - (80f * xDist / Mathf.Abs(xDist)));
- if (Mathf.Abs(xDist) <= 48f || (xGo != Lily.xvel_ / Lily.xspeed_ && Lily.xspeed_ > 0f))
- {
- xDist = follow.transform.position.x - transform.position.x;
- //yDist = follow.transform.position.y - transform.position.y;
- }
- else
- {
- if ((xGo == Lily.xvel_ / Lily.xspeed_ && Lily.xspeed_ > 0f) || Input.GetAxisRaw("Horizontal") != 0)
- transform.position = new Vector3(follow.transform.position.x - (48f * xGo), transform.position.y, transform.position.z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement