You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do you work with references to other nodes from within a Python script? For example, I have a script for an enemy that will follow a Node2D target, and for testing purposes, here is how I have it set up to print the target node's position:
How do you work with references to other nodes from within a Python script? For example, I have a script for an enemy that will follow a Node2D target, and for testing purposes, here is how I have it set up to print the target node's position:
But
self.get_node()
returns aNode
, so as a result, I can't access the position and get this error:AttributeError: 'py4godot.classes.Node.Node.Node' object has no attribute 'position'
Is there a way to get the node type from
get_node()
? Or is there another way to access other nodes?The text was updated successfully, but these errors were encountered: