Comments (3)
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.
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.
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)
- Got Error when enable the GameProfiling HOT 2
- [GameStudio] Code editor doesn't find auto completion info HOT 7
- UI library margins reset to zero HOT 1
- Stride.CommunityToolkit Updates when it shouldn't HOT 3
- Order of Projects in Editor changes the deciding of the main project to launch HOT 1
- Master is completely broken HOT 1
- [master] SOLVED Flashing bar on game with RTSS running HOT 2
- NativeAOT compile support for projects HOT 3
- Add support for OpenXR composition layers
- Stride's Visual Studio Extension does not work in VS2022(17.8.2) HOT 3
- StrideCompilerServices doesnt resolve HOT 4
- a .net exception from fairly simple code HOT 2
- Rigidbody sinks kinetic rigidbody when it moves randomly HOT 4
- JumpyJet Sample Crashes on Android Device When Built in Debug HOT 1
- How to generate shader source from material as text?
- External class reference bug HOT 8
- In-game, clicking the mouse sometimes causes all pressed buttons to be cleared after using EditText.IsSelectionActive HOT 4
- Could not load file or assembly 'Stride.Core.AssemblyProcessor.dll'. HOT 5
- One Of Two Errors when duplicating an Entity in the Stride Editor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stride.