After years of using Javascript, I recently tried to code using Lua so I could create Roblox games. During this transition, I’ve been able to bring many ideas and concepts from Javascript to Lua effortlessly but I recently came across a problem that should seem to work. Assigning variables to Vector3 values.
local part = game.Workspace.Part
local partX = 50
part.Position = Vector3.new(partX, 0, 0)
Above is a simple set of code that, to my understanding, should substitute the X value of the Vector3 with the value of partX (which is 50). Every time I run the game the part is in the same position prior to the code running as if it did nothing at all. No errors occur in the output.
I understand that there are many different ways for the program to carry out this action, but I’m curious as to whether or not this specific method works in Lua.
Did I do something wrong here? Or is this just not a thing in Lua?