#Smooth translation?
20 messages Β· Page 1 of 1 (latest)
This looks like a one frame lag, for example you're using the GlobalTransform of the camera to update the gun's Transform, but either you do it before the gun's GlobalTransform is updated from its Transform (in TransformPropagateSet I think, in PostUpdate) or you do it after but then it's the gun's GlobalTransform that is not reupdated until the next frame.
If that's what's happening, the easiest way to solve this would be to make the gun a child of the camera.
If you don't want to do that, I think it's possible to re-apply the tranform propagation system, or if you're sure that the gun has no parent you can simply calculate the GlobalTransform and update it yourself
Thanks, will investiage the suggested options π
(just in case: a child's Transform is relative to its parent's GlobalTransform, and that is handled by Bevy you don't have to do anything)
If you know for sure your camera doesn't have a parent you can also use its Transform directly to calculate the gun's position
π
do you recall any code snippet that I could look up when it comes to "I think it's possible to re-apply the transform propagation system" ? π if not no worries π
@plucky nymph I don't, I've never tried to do this and not 100% sure it's possible
I believe you could just re-add the systems in TransformPropagateSet at a strategic place
@marble oracle since i'm using bevy_fps_controller here would you have any suggestion as to how you would solve the above with your plugin? π
(building on top of the minimal example really)
I never used bevy_fps_controller (btw someone here has trouble with it if you can help them: https://discord.com/channels/691052431525675048/1136539920014520343 )
Did you try to simply make the gun a child of the camera?
If you're using rapier it has its own transform propagate systems to replace bevy's I think
i tried but run into visibility problems but i also didn't spend too much time on it yet so before doing deep dive checking if there are low hanging fruits π
will check π
Ah yeah to make something a child of a camera and still have it visible you need to add a VisibilityBundle to the camera
Because visibility is propagated through the hierarchy too
Hey, are you still having problems?
Looks like a different package unless I am mistaken
I tried to do this for a game that was using my own crate and ran into the same problem
lol unsure if you want to follow what I did: https://github.com/qhdwight/voxel-game-rs/blob/9945769ebf5d0b2c99987babc31f36f68b1cf75b/src/qgame/inventory.rs#L385C17-L385C17