About Start () and Update () Methods

Why do we Write [ startPos = transform.position;] in Start Function.
and whys it’s not working in Update () Function.

(This Script is for Repeating Background)

Hi Ajeet,

Welcome to our community! :slight_smile:

startPos is supposed to be read as “starting position”. The starting position is not supposed to change because that’s our reference position. The Update method gets called once a frame meaning multiple times during the existence of the RepeatBackground object. If we assigned the current position to the startPos variable each frame, the information on the initial position would get lost.

Please feel free to test your idea to see what happens.

Did this help?


See also:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms