- What are you attempting to achieve?
I am creating a game where large areas of the map are randomly generated. Some parts are ‘fixed’ (e.g. outer walls of buildings) and other parts are randomly placed (e.g. internal walls, doorways, etc.).
- What is the issue?
Functionally I have this working, but I would like to re-use variables (or constants) for the parts (i.e. both ‘fixed’ and randomly placed parts). For example, I would like to create a variable for ‘Wall Height’ and associate it to the Y size property of all wall parts, allowing me to easily change the value later (which I’m sure I will need to!) without having to locate and edit multiple scripts and parts.
Most of my 3D experience to date has been with CAD tools like OpenSCAD and Fusion 360, which support something like this. I.e. I can define a value once and use it all over the design. I believe this is known as ‘Parametric Design’.
In Roblox Studio I am unable to find a way to achieve this without using scripts. I am happy to use scripts in principle, but then I have to ‘Run’ the game every time I make a change in order to see the parts in the editor. This usually wouldn’t be a problem but when creating a game like this I have to run the game often and this is slowing the development process somewhat.
I am very new to Roblox Studio and it is possible that it simply does not support my desired workflow, but I am worried that if I continue to create/duplicate parts as I have so far, each with their own unique (albeit identical) values, my project will becoming increasingly difficult to maintain. Therefore, I just wanted to check that I’m not missing something simple, before my project gets too complicated.
- What solutions have you tried so far?
I am currently storing these values in multiple places. I am storing them in scripts (for randomly placed parts) and individual property values for ‘fixed’ part instances placed through the editor.
Any ideas or tips from those who have more experience at this than me would be very much appreciated.
Thank you for reading this!