Vector3.zero or Vector3.new(0,0,0)?

Title?

Both are basically the same aren’t they?
Pretty sure they work as the same thing.

I would personally rather use Vector3.new(0, 0, 0)

Vector3.zero is faster.

local C = os.clock()
for _=1, 10000 do
	local Lol = Vector3.new(0, 0, 0)
end
print("Vector3.new: " .. os.clock()-C)

local D = os.clock()
for _=1, 10000 do
	local Lol = Vector3.zero
end
print("Vector3.zero: " .. os.clock()-D)

image


It comes down to preference though. I suggest using the method that keeps you the most organized.

1 Like

Probably because its premade instead of you creating it manually

ok.
thanks

1 Like

Much like CFrame.identity, Vector3.zero is an easy-access variable so that you don’t have to create a new vector and waste resources doing so.

2 Likes

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