Unexpected crash from the function Dir3::new_unchecked
when launching the App
#17238
Labels
A-Transform
Translations, rotations and scales
C-Bug
An unexpected or incorrect behavior
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
P-Crash
A sudden unexpected crash
S-Waiting-on-Author
The author needs to make changes or address concerns before this can be merged
Bevy version
0.15.1
[Optional] Relevant system information
cargo 1.83.0 (5ffbef321 2024-10-29)
Ubuntu 22.04.5 LTS
What you did
My game hadn't crash before I add the
Gun
component to the player as a child component like thisAnd this is the
Gun
ComponentWhat went wrong
I was expecting the
Gun
to spawn next to the player.But I received this panic message
We can see on this error message that there append to be a problem updating the position of a camera, and the only camera that I spawned was the player camera like that
Since the problem was related to a
Dir3
, I verified theGun::new()
function, since it's the only place where I use aDir3
. But the function hereunwraped a
Ok
variant with this valueThen, someone suggested to me in the bevy server that a maybe messed with the camera transform, witch I don't because the program crashed because I couldn't even move the player, and so, the gun, so the problem is not with the camera's
Transform
modification in the other functions but when I spawn the camera. I even tried to move the place where I spawn the camera from the functionspawn_player
to the functionspawn_gun
like thisbut it still crashed.
The only way to make it not crash was to not spawn the Camera2D.
Additional information
the full log with RUST_BACKTRACE=1;
The text was updated successfully, but these errors were encountered: