- Home /
Move the screen when object close to screen borders.
Hi. I'm new in Unity. I have a script which can move background with parallax effect.infinitely. If i attach the main camera to the object. when i move object camera and background moves. but i want to drag object in screen. but for reason main camera moves with the object, it seems like it doesnt dragging. i deattach the camera from the object. but then i can drag it but background doesnt scrool. i wanna drag object and when object arrrives border of the screen (vertical +1 or -1 value) , then background must start scrooling.see the picture.thank you.
You should probably use Camera.WorldToScreenPoint to detect when the object is near the end of the screen and react accordingly.
Your answer
![](https://koobas.hobune.stream/wayback/20220613174718im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Resize / Scale, Drag, Move a Plane at Runtime by Mouse action 2 Answers
Creating a "drop zone" for textures 1 Answer
Drag object in unity 2d with moving camera 0 Answers
Dragging an object smoothly 2 Answers
Need help debugging: SiblingIndex 0 Answers