- Home /
What is the new way to convert gameObjects to entities?(ECS scripting)
I used this script to spawn bullets, it was fine then but now it says that it is obsolete:
Entity Prefab = GameObjectConversionUtility.ConvertGameObjectHierachy(_gameObjectPrefab, World.DefaultGameObjectInjectionWorld);
I tried several ways but when I press play, the debugger says that it's missing a blob assetstore, I don't know what it is, this is my new script:
var setting = GameObjectConversionSettings.FromWorld(World.DefaultGameObjectInjectionWorld, null); Entity Prefab = GameObjectConversionUtility.ConvertGameObjectHierachy(_gameObjectPrefab, setting);
Can anyone who knows about ECS tell me what should I do? Thanks in advance!
Answer by Arcvista · Apr 22, 2020 at 10:39 PM
this.particleEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(particlePrefab.gameObject, new GameObjectConversionSettings()
{
DestinationWorld = World.DefaultGameObjectInjectionWorld
});
Your answer
Follow this Question
Related Questions
How To Put 2 Panel in 1 scene? 2 Answers
How can I make my player stay in the directions i have assigned to it? 0 Answers
Recursive function that allows me to do stuff in the meantime 3 Answers
How do i change the text color on GUI.Label ? 1 Answer
How do I place sprites with my script and a 2D array? 2 Answers