Skip to content

derive FromTemplate is preventing TilemapChunkTileData to be used in template_value #24416

@hxYuki

Description

@hxYuki

Bevy version and features

  • main@3c37a4d9035a

What you did

use template_value(TilemapChunkTileData(...)) in bsn!.

What went wrong

This type does not manually implement `FromTemplate`, ...

...

the trait bound `TilemapChunkTileData std::marker::Unpin` is not satisfied ...

Additional information

Not sure if there is something wrong with the marco itself, or just simply to be a misuse for FromTemplate.

For convenience, the following demonstration uses a similar type S.

#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect, FromTemplate)]
#[reflect(Component, Clone, Debug)]
pub struct S(Vec<Option<TileData>>);
Image Image

If replace FromTemplate to Default, it works:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ScenesComposing and serializing ECS objectsC-BugAn unexpected or incorrect behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions