Hi all,
I’m running into an issue where an if statement that isn’t supposed to run still runs. To put, I created an instance of a model that has a name, and if its name is “End”, then the if statements aren’t supposed to run, however, it still does and returns the error shown in the picture below along with copy.Name printed, which can clearly be seen as “End”, even though the code was told explicitly that if copy.Name was “End”, it shouldn’t have ran. Any help with this would be greatly appreciated, as I don’t know what could be causing this.
if target == "Front" and copy.Name ~= "End" then
generatePart(copy.Connectors.Front.Position, length + 1, false, rotation)
print(copy.Name)
copy.Connectors.Front.depth = copy.Connectors.Front.depth + 1
elseif target == "Left" and copy.Name ~= "End" then
generatePart(copy.Connectors.Left.Position, length + 1, false, rotation + 90)
print(copy.Name)
copy.Connectors.Left.depth = copy.Connectors.Left.depth + 1
elseif target == "Right" and copy.Name ~= "End" then
generatePart(copy.Connectors.Right.Position, length + 1, false, rotation + 270)
print(copy.Name)
copy.Connectors.Right.depth = copy.Connectors.Right.depth + 1
end