Skip to content

Commit a18e2b1

Browse files
committed
Reflect Default for GlobalTransform (#6200)
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as #6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
1 parent 6ae46f6 commit a18e2b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_transform/src/components/global_transform.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ops::Mul;
33
use super::Transform;
44
use bevy_ecs::{component::Component, reflect::ReflectComponent};
55
use bevy_math::{Affine3A, Mat4, Quat, Vec3, Vec3A};
6-
use bevy_reflect::{FromReflect, Reflect};
6+
use bevy_reflect::{std_traits::ReflectDefault, FromReflect, Reflect};
77

88
/// Describe the position of an entity relative to the reference frame.
99
///
@@ -32,7 +32,7 @@ use bevy_reflect::{FromReflect, Reflect};
3232
///
3333
/// [`global_vs_local_translation`]: https://github.com/bevyengine/bevy/blob/latest/examples/transforms/global_vs_local_translation.rs
3434
#[derive(Component, Debug, PartialEq, Clone, Copy, Reflect, FromReflect)]
35-
#[reflect(Component, PartialEq)]
35+
#[reflect(Component, Default, PartialEq)]
3636
pub struct GlobalTransform(Affine3A);
3737

3838
macro_rules! impl_local_axis {

0 commit comments

Comments
 (0)