Which practice is better?
local bp = Pet.BodyPosition
while true do
wait()
bp.Position = --a vector 3 position
end
OR
while true do
wait()
Pet.BodyPosition.Position = --a vector 3 position
end
Which practice is better?
local bp = Pet.BodyPosition
while true do
wait()
bp.Position = --a vector 3 position
end
OR
while true do
wait()
Pet.BodyPosition.Position = --a vector 3 position
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
6 comments
bp is nil in the loop in the first script
But let's say that Pet is already defined
You should make variable outside the loop it is a constant value
@MC wrong
Matter of style mainly - do whichever you personally prefer. The first is technically faster, but unless the section of code you're running it in is REALLY hot, you won't see a noticeable difference.
If you're going to use bp a lot, then set a variable for it.