Skip to content

Freeing a Node with a running ShakerComponent makes the game crash #9

@joancardonasa

Description

@joancardonasa

Describe the bug
Freeing a node while it has a ShakerComponent shaking any of its properties makes the project crash because it tries to access a target Node that no longer exists.

To Reproduce

  1. Create a sprite2D.
  2. Call Shaker.shake_property(...) on its position during 1 second, enough to have time to delete the node before it finishes.
    queue_free the node via input(event) or process or whatever's quickest.

Expected behavior
I would expect Shaker to quietly halt any shake its running on freed nodes.

Screenshots
I added a target != null check in shaker_component.gd to see if that fixed the issue, but it doesn't, as can be seen in the screenshot:

image

Desktop (please complete the following information):

OS: Windows 10, 11
Shaker Version 1.6.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions