Hi - here is some example code that works in SkookumDemo
. It grabs a mesh from one of the cubes, and attaches it to the hero mannequin so it hovers above it:
!cube : @'SM_DemoCube_2'
!cube_mesh_component : cube.component_by_class(StaticMeshComponent.static_class)<>StaticMeshComponent
!mesh : cube_mesh_component.@static_mesh
!hero : Hero.instances_first
!new_component : StaticMeshComponent!new(hero "MyComponent".Name)
new_component.register_component
new_component.attach_to(hero.root_component)
new_component.static_mesh_set(mesh)
new_component.relative_location_set(Vector3!xyz(0 0 Real.@@meter))
Let me know if this works for you and if it solves your problem!