Difference between this.transform.position and transform.position = paddlePos;

As far as I can tell both ways of coding the transform.position method result in the same outcome. What’s the purpose of the this keyword in this case?

    this.transform.position = paddlePos;

    //alternative form of writing this
    transform.position = paddlePos;

https://gist.github.com/in-JUST/80637e897b521a2c25a460ccc2fd2525

I actually answered this question not long ago :slight_smile:
https://community.gamedev.tv/t/solved-question-about-this-keyword?source_topic_id=35934

1 Like

Privacy & Terms