Hi I really like this plugin! It allowed me to very quickly add basic scripting support to my project, appreciate all the hard work!
Describe the bug
I encountered a bug where I tried to spawn an entity via script. for this i simply created a function, something like this:
fn spawn_modded_entity(
mut commands: Commands,
) {
commands.spawn(Name::new("ModdedEntity"));
}
And if I then call this via script, it indeed spawns an entity, but it has no components (in this case it should have a Name component, See screenshots below).
commands.entity(entity).insert() also doesnt seem work.
I'm not sure if this is a bevy or scriptum problem, but i tried to also call the same function as a normal bevy system and there it works fine.
To Reproduce
Steps to reproduce the behavior:
- Spawn an entity with a script, this script should call a rust function in which you spawn a very simple entity with at least one component.
- start the game
- check if entity has the specified components
Expected behavior
It to spawn an entity with all the specified components.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
I was able to work around this by making the functon send out a bevy event which then runs a system in which the entity gets spawned. but i would like to be able to instantly return the id of the entity to keep using it via scripts, and with this workaround i won't be able to do so.