UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"scroll over 2d background"
public class ScrollScript : MonoBehaviour { float scrollSpeed = -5f; Vector2 startPosition; private void Start() { startPosition = transform.position; } private void Update() { float newPosition = Mathf.Repeat(Time.time * scrollSpeed, 20); transform.position = startPosition Vector2.right * newPosition; } }