How can I create instances of PropertyGroups with independently editable variables? I'm currently making an addon to randomize path variables, and need lots of groups of variables that I can independently edit. I've been trying to get Property Groups working with this but can't figure out how to make instances of the Property Groups and still be able to edit the variables inside them.

Here's what I have:

the main PropertyGroup

class PathNode(PropertyGroup):
    path: StringProperty()
    minvar: FloatProperty()
    maxvar: FloatProperty()
    randomize: BoolProperty()


this is how I've been trying to make multiple instances of it, with "pathsam" as an IntProperty

bpy.types.Object.pathsam = CollectionProperty(type=PathNode)


Does anyone know how to either fix this, or know how to create multiple instances of the main path variable where the variables can still be independently accessed and edited?
In general adding property groups to object types can be done with

import bpy


class PathNode(bpy.types.PropertyGroup):
    path: bpy.props.StringProperty()
    minvar: bpy.props.FloatProperty()
    maxvar: bpy.props.FloatProperty()
    randomize: bpy.props.BoolProperty()

classes = [PathNode, ]


def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Object.pathsam = bpy.props.PointerProperty(
            type=PathNode)


def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    del bpy.types.Object.pathsam

if __name__ == "__main__":
    register()