Git Product home page Git Product logo

Comments (3)

Kryptos-FR avatar Kryptos-FR commented on June 13, 2024

Easy to fix: do the fixup in your entity processor.

What is the actual use case of instantiating prefabs from within an entity processor? I don't think it should be done this way. It's not the purpose of an entity processor in my opinion. That should be better done with a script. The purpose of an entity processor is usually to gather associated data (such as sound instance, animation system, etc.), not to instantiate more entities or prefabs. What will happen if the prefab also contains the same custom component: it might create a recursive loop, with new entities being instantiated forever.

Note: I'm not saying there is no bug in this area. But I think more analysis should be done to understand the underlying issue and the consequence of any "fix". For instance, in the editor we have some flags to fixup ids when using the AssetCloner (see sources/assets/Stride.Core.Assets/AssetCloner.cs and sources/assets/Stride.Core.Assets/AssetClonerFlags.cs). The fact that it crashes in the editor indicates it tried to do some instantiation in the editor game which is not a supported behavior.

from stride.

laske185 avatar laske185 commented on June 13, 2024

The use case is that I want to create a generic environment, based on the settings in the EntityComponent, from combined prefabs at runtime.

My only known way to see this generic environment in game studio is to use an EntityProcessor. This is because, unlike ScriptComponents, it is also executed in the game studio.

Or are there other options?

from stride.

Eideren avatar Eideren commented on June 13, 2024

Right now there aren't, no. What you're trying to do is not yet supported, the editor builds a layer on top of the scene hierarchy that abstracts away a couple of things. It doesn't really expect new entities being spawned through user-code.
This is something that we should support in the future, likely after the editor rewrite, but right now your example is kind of outside supported behavior.
The underlying issue may not be though, if you can replicate this issue at runtime then we should definitely look into that.

from stride.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.