Hi guys,
I’m scrolling a GameObject using its transform.position - At first I put the code in the Update function and then thought it was physic related so I moved the code to the FixedUpdate function. When the code was in the Update function the scrolling was very smooth whereas in the FixedUpdate function the scrolling is laggy. I tried to add or remove a rigidbody2D into my GameObject but I didn’t see any differences.
The code :
void Update () {
Vector3 newPos = new Vector3(gameObject.transform.position.x,gameObject.transform.position.y,0);
newPos.y -= Speed * ParallaxFactor * Time.deltaTime;
gameObject.transform.position = newPos;
}
Is that normal ? Am I doing the right thing ?
Thank you