How to spawn a scenegraph entity prefab

I’m trying to add an entity_prefab to the scene on command, but this seems to be impossible. Does any of you a idea?

To give more insight. In short: The prefab is a supply drop that falls from the sky. When it landed You can open it. I want to be able to set a location and spawn it like you can with normal blueprints

Let me know if you have suggestions

Here you go just replace “Prefab_new_entity”

    TestFunction():void=
        MyNewEntity:=Prefab_new_entity{}
        if(SimEntity:=GetSimulationEntity[]):
            SimEntity.AddEntities(array{MyNewEntity})

Unfortunately, this gave me an error

This function parameter expects a value of type entity, but this argument is an incompatible value of type entity_prefab.(3509)

MyNewEntity:entity_prefab

This function parameter expects a value of type entity, but this argument is an incompatible value of type entity_prefab.(3509)

(/Fortnite.com/Devices:)operator’.GetSimulationEntity’[CreativeDevice:creative_device]:entity

1 Like

Do not use entity_prefab use the direct entity that’s exposed, entity_prefab is not for us to use

Where is it located in the API? In my Verse.digest I cannot find the Prefab_new_entity

Check your assets digest not the verse digest, what is the name of your prefab?

Oh! I’m stupid, found it and understand it now!

Thank you!

1 Like

No problem happy to help, it’s all good It also took me a while to understand how to create new prefab instances initially. I’d recommend learning more about it if you plan to use custom items in the future when they leave experimental, since all these items are prefabed “entites”

Yeah, did not know there was a non-asset version. If I’d looked at the Assets digest, I would have found out! Thank you, saved a lot of headaches for today!

Since you know how it works, do you know how to dispose/despawn the asset again?

1 Like

Yes. you call .RemoveFromParent() on the entity

1 Like