Which would be more Efficient?

Hi,

So Right now I have a Script that is supposed to move the Player a Specific Direction using Constraints, This is done on the Client for Optimization Reasons and to avoid unnessacary computations with the Server, but I was wondering about Creating the Constraints, and what would be best to do.
There are 3 ways I can think of for Creating/Adding a Constraint to the Player:

  • Instance.new()
    I can create the Constraint I want, Apply all its properties, and then Parent it to the Player Instead of having more Instances Exist at one time.

  • :Clone()
    I can have the Constraint Already Existing somewhere, and then Clone it into the Player when needed.

  • StarterCharacter
    I can have it already Parented into the Character when they spawn into the game and Activate the Constraint when needed.

Though all these work, I’m not sure whether they are good for small optimization, or no optimzation to be concerned about, I’m also not sure which approach would be more efficient to execute in general.
So what would be more Efficient out of the 3 of these examples?

7 Likes

the last one is the “most efficient” but you should probably do whatever is easiest to implement because the speed difference between the three options is practically zero

1 Like

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