I wanna know which one is more performance CFrame Math or Weld?
In my own opinion I think that CFrame Math is more friendly because of the part being anchored while welding a certain anchored part to the player just glitches the character, anyone who knows the answer to this?
Using the physics engine is most likely going to eat up more performance. However, it can also be quite costly to set the CFrame value of a ton of parts every frame. What are you trying to accomplish exactly?
I wouldn’t really say that one is more performant on the other because that’s use case specific. Both of them have their respective purposes in an assembly. As well, in various cases, you can use both of these together.
Replication of this specific code for now:
p.CFrame = HumanoidRootPart.CFrame-HumanoidRootPart.CFrame.lookVector*2
Honestly, I’m not sure which one is going to be better, but both are not going to have significant performance issues. Personally, I would use a weld just for the sake of keeping it simple.
Alright thanks for your help, I’ll wait if anyone else knows the answer to this.
I believe you can just weld the part to the character and set it’s massless property to true and it shouldn’t affect player physics? Maybe I’m wrong.
CustomPhysicalProperties helps with this too but I mainly care about the performance that CFrame Math and Weld have to a game.
If you don’t need any physics or Touched events then I’d anchor the part, set CanCollide false and use CFrame, as the physics engine won’t have to do anything with it.
Let’s say it’s a 100 Players Game and you have to replicate it, which one would be better?
cframe is definitely easier but i think that weld should be more performant
*note* I am assuming you are setting the C0 and C1 once and then never touching them again (or at least not updating them every frame), if this is not the case, I’m not sure if Motor6D.Transform (what you should be using instead of welds if you are constantly updating the offsets) is more efficient than cframe
so if you set C0 and C1 once and never touch them again, I believe Welding is much more efficient because you are telling the Roblox physics engine once how you want to position the part and then it should basically treat the welded part as an extension of the character
This is advantageous because you are not running lua code often (slowww) and Roblox can probably make some optimizations such as treating Part1 as part of the rigid body of Part0 (I’m not sure if this is done, but I believe they could do it and might in the future)
you can accomplish the same thing by welding
and on top of setting cancollide false, you should create a collisiongroup that doesn’t collide with any other group and add it to that
The amount of memory used by a weld is probably insignificant (idk a specific number and it would be nice to know specific numbers of how much memory instances use but think about what it actually represents)
Assuming you aren’t using SetPrimaryPartCFrame, probably CFrame. Welds also eat up memory afaik.
I wanted to work on an idle animation for this specific part so I guess I’ll go with CFrame since Welds eat up memory OOF YOU JUST EDITED