If it helps, visualize the class (type) hierarchy as a tree. This is called inheritance. Many Instances in Roblox extend from an abstract Instance. In the case of Parts, BasePart is the root of the tree, and Part, TrussPart, MeshPart, etc. are the branches - they branch off from the root. If a class doesn’t have anything extending from it, it is called a leaf(Instance (root) -> BasePart (branch) -> TrussPart (leaf). Abstract means the type cannot be created/instantiated. For example, this code is invalid: Instance.new("BasePart")
You cannot create a BasePart, but you can create one of the BaseParttypes that extend from the abstract BasePart class.
Here’s where it gets weird: Everything is an Instance. Even BasePart. So, now we have an even deeper root. Another abstract type is GUIObject. If we implement that into our visual hierarchy, our tree now may look something like this:
___________________________________________________.. --> A LOT of other Instance classes, some abstract, some not! -->
____________________________ __________________________.. --> A LOT of other GUIObject classes -->
| | | | | |
[Part] [TrussPart] [MeshPart] [Frame] [TextLabel] [Image]
The particular issue with your code is exactly as you described: You need to provide an Instance that has a Position property. You can supply a type “Part”, but this will create an issue later down the line if you or someone else tries to pass in a “TrussPart” to your function - your code will cry and you will be sad. To get around this, use the root class: BasePart, which every other part extends from! You’re covering all the bases, woohoo!
Thanks, I always thought the only class that could be used to define other ones(abstract) was BasePart, also, found a link for anyone browsing this topic with all the classes and their “parents” and “childs”: https://roblox.fandom.com/wiki/Class_reference