Skip to main content
added 504 characters in body
Source Link
Carlos
  • 101
  • 2

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

All the parallax background scrolling tutorials show only moving on one axis, either x or y, but my case it could be to any possible direction like an arrow compass.

Can some one point me in the right direction about how I can implement this effect?

EDIT: User can move to any possible direction like an arrow in a compass. enter image description here

Custom Camera Controller that follows the player

public class CameraController : MonoBehaviour {

    public GameObject Player;

    private Vector3 offset;

    // Use this for initialization
    void Start () {

        offset = transform.position - Player.transform.position;
    }
    
    // Update is called once per frame
    void LateUpdate () {

        transform.position = Player.transform.position + offset;
    }
}

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

All the parallax background scrolling tutorials show only moving on one axis, either x or y, but my case it could be to any possible direction like an arrow compass.

Can some one point me in the right direction about how I can implement this effect?

EDIT: User can move to any possible direction like an arrow in a compass. enter image description here

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

All the parallax background scrolling tutorials show only moving on one axis, either x or y, but my case it could be to any possible direction like an arrow compass.

Can some one point me in the right direction about how I can implement this effect?

EDIT: User can move to any possible direction like an arrow in a compass. enter image description here

Custom Camera Controller that follows the player

public class CameraController : MonoBehaviour {

    public GameObject Player;

    private Vector3 offset;

    // Use this for initialization
    void Start () {

        offset = transform.position - Player.transform.position;
    }
    
    // Update is called once per frame
    void LateUpdate () {

        transform.position = Player.transform.position + offset;
    }
}
explaining possible player movement with compass graphic
Source Link
Carlos
  • 101
  • 2

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

All the parallax background scrolling tutorials show only moving on one axis, either x or y, but my case it could be to any possible direction like an arrow compass.

Can some one point me in the right direction about how I can implement this effect?

EDIT: User can move to any possible direction like an arrow in a compass. enter image description here

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

Can some one point me in the right direction about how I can implement this effect?

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

All the parallax background scrolling tutorials show only moving on one axis, either x or y, but my case it could be to any possible direction like an arrow compass.

Can some one point me in the right direction about how I can implement this effect?

EDIT: User can move to any possible direction like an arrow in a compass. enter image description here

Rephrasing to clarify that the solution doesn't have to br exactly what slither uses, just something that achieves the same effect
Source Link
DMGregory
  • 136.3k
  • 22
  • 247
  • 373

How can I implement an infinite parallax background like in Slither.io parallax works?

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

Can some one point me in the right direction about the algorithm implementedhow I can implement this effect?

How Slither.io parallax works?

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

Can some one point me in the right direction about the algorithm implemented?

How can I implement an infinite parallax background like in Slither.io?

I am trying to replicate the endless scrolling of slither.io but, I can't figure out how to implement it. Since the players can move to any direction and the background needs to be available during player's displacement.

Can some one point me in the right direction about how I can implement this effect?

Source Link
Carlos
  • 101
  • 2
Loading