aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.03k stars 540 forks source link

Get Canvas Position node only returning values once #439

Closed FiniteStateGit closed 4 years ago

FiniteStateGit commented 4 years ago

Describe the bug Get Canvas Position node of Script Canvas is only retrieving correct values once, subsequent calls return incorrect values.

Steps to reproduce Create UI Canvas, create first element to fill screen (100% Bottom and 100% Right Anchors). Create second element as child of first element with bottom and right anchors set to 100%, set width and height offsets to 50px, add default image component for visibility. Create one entity with UI Canvas Asset Ref pointing to the newly created UI Canvas. Create second entity with Input and Script Canvas components, input bindings register Mouse Left Click, Script Canvas loads canvas, finds child element by name, connects to input bus and gets canvas position of child element on left click, printing the position to console. First left click prints the child element's coordinates correctly, however, subsequent clicks print (0,0) for child element's coordinates. Visually, the child element remains in same position.

Expected behavior Please provide a concise description of what you expected to happen.

Screenshots/Logs BugGetCanvasPosition

BugGetCanvasPositionScriptCanvas

Lumberyard version 1.21

FiniteStateGit commented 4 years ago

The reference to the child's entity ID expired. Saving the ID to a variable was necessary. Closing this issue.