Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting actor_node_path to a non-parent throws an error #341

Open
rxlecky opened this issue Jun 5, 2024 · 0 comments
Open

Setting actor_node_path to a non-parent throws an error #341

rxlecky opened this issue Jun 5, 2024 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@rxlecky
Copy link

rxlecky commented Jun 5, 2024

Godot version: 4.2.2
Beehave version: 2.8.0

Describe the bug
When setting the actor via the actor_node_path property to a node that is not the parent of the behaviour tree node, the following error is thrown:

E 0:00:00:0785   beehave_tree.gd:38 @ @actor_node_path_setter(): Node not found: "../.." (relative to "Node").
  <C++ Error>    Method/function failed. Returning: nullptr
  <C++ Source>   scene/main/node.cpp:1651 @ get_node()
  <Stack Trace>  beehave_tree.gd:38 @ @actor_node_path_setter()

This happens because the setter is called before the node is added to the scene tree so the get_node() call fails to fetch nodes higher up in the tree. This issue doesn't happen when setting the actor via the actor property.

To Reproduce
Steps to reproduce the behaviour:

  1. Create and populate a behaviour tree
  2. Set its actor_node_path property to a node that is not its parent
  3. Play the scene
  4. See error

Reproduction project
BeehaveIssueMRP.zip

@rxlecky rxlecky added the 🐛 bug Something isn't working label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant