Skip to content

AnnotationManager props do not apply to the variables #306

@ice1080

Description

@ice1080

When creating annotations using the Script component such as this:

import { AnnotationManager } from 'playcanvas/scripts/esm/annotations.mjs';
...
<Script
  script={AnnotationManager}
  hotspotSize={200}
  opacity={0.5}
  hotspotColor={[0, 1, 0, 0.5]} // just example numbers
  hoverColor={[1, 0, 0, 1]}
/>

In this case, the hotspotSize is applying correctly, but the hotspotColor and hoverColor do not work.

Is there a better way to use this? The docs do not mention useScript, but I see that the Script component uses this under the hood.

I guess the real question is if Annotations should be created via the Script component, or manually created in useEffects in a custom script or similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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