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.
![image](https://private-user-images.githubusercontent.com/42088586/262480508-8d209923-dd7b-483c-94c2-c5bc0fd6bca2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc5MzY2NDYsIm5iZiI6MTcxNzkzNjM0NiwicGF0aCI6Ii80MjA4ODU4Ni8yNjI0ODA1MDgtOGQyMDk5MjMtZGQ3Yi00ODNjLTk0YzItYzViYzBmZDZiY2EyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA5VDEyMzIyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjNWRiODJiOTdiZGY3YTk0ODNmZDNlMjQxN2U1NDYwZDNlNWU1ODBmZjRkZTE2MTJiYWYwNjUxN2FmMDZmYmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qeyrzSFq-_Q4yT2_pEzlBWVFoBGS2d92gTQ99A97ILI)
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.