Gizmos seem slow to draw #12005
Unanswered
franklinblanco
asked this question in
Q&A
Replies: 3 comments 4 replies
-
Additional Context: Registering the system:app.add_systems(FixedUpdate, draw_debug_bore_laser)
.insert_resource(Time::<Fixed>::from_hz(240.0)) System:pub fn draw_debug_bore_laser(
query: Query<&GlobalTransform, (With<InPlayerHandsMarker>, With<FiringPoint>)>,
mut gizmos: Gizmos,
) {
for transform in query.iter() {
let max_toi = transform.forward() * 20.0;
gizmos.line(
transform.translation(),
transform.translation() + max_toi,
Color::Rgba { red: 2.5, green: 0.0, blue: 0.0, alpha: 1.0 },
);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
I had a similar issue and I solved it by making sure that the gizmos are drawn after the camera is moved. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Its most likely because you added the draw_debug_bore_laser system to the FixedUpdate schedule which doesn't always run before the screen is rendered. I would suggest adding it to the normal Update schedule. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to draw gizmos for a laser, and it seems to be slow at drawing the actual line. Can't figure it out, already tried to run it on a FixedUpdate of 240hz and 100hz and 60hz, nothing has solved it.
Preview:
Untitled.mov
Beta Was this translation helpful? Give feedback.
All reactions