Question by
jurgen2320 · Dec 21, 2021 at 03:08 PM ·
movement script
add moving background to moving object
Right now i have a script for a looping background using 2 background pictures.
Does anyone know how i can add these backgrounds to a moving object
void Update()
{
transform.position += new Vector3(0, 5 * Time.deltaTime);
if (transform.position.y > 22.8)
{
transform.position = new Vector3(transform.position.x, -58f);
}
}
this is the script im using for the backgrounds taking eachothers places
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613050809im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to tidy up my code for Unity 5 Basic Platformer 1 Answer
How do I stop the player from shaking in Unity2D? 2 Answers
Skid steer type movement 1 Answer
Move Player along normal of floor? 1 Answer
Move a selected object. 0 Answers