Announcement

Collapse
No announcement yet.

Python - Attach component to Actor or Blueprint

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Python - Attach component to Actor or Blueprint

    Hello, please help
    I'm trying to add a Instanced Static Mesh Component to and Actor
    I just using the default Empty Actor
    I manage to get the Component to be added but it tell me I can edit it
    Click image for larger version  Name:	Native.jpg Views:	1 Size:	22.6 KB ID:	1633686
    I have used UPROPERTY on C++ but I have no idea how to do it in Python
    this is the code I'm using
    Code:
    import unreal
    actor = unreal.EditorLevelLibrary.get_selected_level_actors()[0]
    instance_component = unreal.InstancedStaticMeshComponent()
    unreal.uproperty(unreal.InstancedStaticMeshComponent())
    instance_component.attach_to_component(actor.root_component, ' ', unreal.AttachmentRule.KEEP_WORLD, unreal.AttachmentRule.KEEP_WORLD, unreal.AttachmentRule.KEEP_WORLD, False)
    actor.set_editor_property('root_component', instance_component)
    It would be great if I can create the Empty Actor from the code as well, if that is possible. Thank you for your help

    #2
    I also encountered this problem.Who can help .Thanks

    Comment

    Working...
    X