Closed PiergiorgioZagaria closed 6 months ago
We are a bit stalled this couple of months, and we'll take a look as soon as we have time. If you have an idea where this happens, you are welcomed to create a PR and ask for our support
I have little time to fix the bugs. I already tried to replicate the bug on a simple cube model on main branch, but everything worked correctly for me. Perhaps the problem is probably that conflicts with hot reload or I didn't cover some kind of data in your model when converting it to bevy scene. Would you feel comfortable sharing the 3d model from the video?
Here it is. It's not mine, it comes from this github project (kenney.nl FPS starter kit for godot). I wanted to try and rewrite it in bevy
I was able to reproduce! I didn't immediately notice that you were using the "Open sub-scene" button. If our interface is confusing, canonically in space_editor you should use the leftmost button on the top panel to reopen saved editor scenes. That's exactly what opens the prefab.
"Open subscene" is designed to open gltf with skeletal animation and perceives the opened object as a model, which has a center of coordinates zero. But the bug with infinite rotation is certainly a bug and I will try to fix it!
How do you add a prefab to another scene then? That's what I wanted to do.
Like for example, I add the rigidbody and collider to the platform, make it a scene, and then import it a bunch of times in the main_game scene. This way I don't have to set the collider all the time I create a new platform.
Do I need to spawn it from code?
There are three paths we have in version 0.5.
commands
.spawn(PrefabBundle::new("scenes/Scene0.scn.ron"))
.insert(Name::new("Prefab"));
Additionally, you can use "Clone" for entities. For example, if you set the path once for a subprefab or colliders, you can easily reproduce it. It allows you to clone an entity and all its children and all its components. It is available either through the context menu in the Hierarchy panel or by holding Alt and pulling the gizmo in the entity move mode. You can even clone multiple entities with Alt+Shift
I figured out the cause of the problem. bevy_xpbd glitches if rigidbody has some parent and starts to continuously shift/rotate by the parent's transform value. As far as I remember everything worked in the old version of bevy_xpbd and this is some new changes or I don't remember well, but in any case I need to create a mechanism to load prefabs without creating additional parents. It is not difficult and it will take me hopefully only two days. I'll add it to the 0.6 branch and post here when I'm done and check that there are no more problems with the new mechanism for rigidbody.
EDIT Never mind, I found my code that fixed the hierarchy bug for the old version of bevy_xpbd and it just conflicted with the new version of bevy_xpbd where everything works. Will fix soon
@PiergiorgioZagaria Looks working for me #306
Works for me too, just tested the branch :+1: . Do I close the issue or wait until it's merged?
I will merge ang close. Thanks for bug report and help!
Describe the bug When importing a subscene, like for example a platform with a rigidbody, when modifying either the position or rotation, the subscene keeps moving by that transform when inside the editor, but stops when running the game
To Reproduce
https://github.com/rewin123/space_editor/assets/75474806/e6e555e6-f596-4429-b8a8-eaf70f73b6d1
Compiled with the following code:
And the following dependencies:
Expected behavior Setting the transform of the subscene shouldn't mae it move in the editor
Screenshots I uploaded the video as an example
Desktop (please complete the following information):