I have made like a game where you have to escape an ancient pyramid and I had one stage where there are different pillars on the floor with Egyptian hieroglyphics on them and in front of of the player there is a sign that says an English word an at the wall there is a paper scroll that the player has to use to translate the English letters to hieroglyphics and find the correct way on the pillars
So I have a dictionary with the English letters and the corresponding Vector2s for the ImageRectOffset because I'm using like a sprite sheet idk. Here is my dictionary
local HieroglyphsTable = {
['A'] = Vector2.new(0,0);
['B'] = Vector2.new(0,170);
['C'] = Vector2.new(0, 340);
['D'] = Vector2.new(0, 510);
['E'] = Vector2.new(0, 680);
--and so on
}
Here is the part where I apply the ImageRectOffset Vector2's to the pillar parts:
HieroglyphImageLabel.ImageRectOffset = HieroglyphsTable[math.random(1, DonutLibrary.GetTableLenght(HieroglyphsTable))]
By the way this GetTableLenght is a function that returns the table's length and I tested it that works
My error now is this one: Unable to assign property ImageRectOffset. Vector2 expected, got nil
I've already tried asking ChatGPT but it of course doesn't help that good like humans do, it said something like that I should use Vector3 but why? I've tried all solution I found online but nothing helped me. Can you help me??