How to play specific animations from resource script attached to node?

Godot Version

4.3

Question

For my game critter battle card game, im using resources to diferentiate the different mechanics each card should have, all extending a base resource that has generic behaviours to avoid redundant code. The script housing the behaviours are attached to a resource that is attached to the root node of the generic card scene.
To start, im trying to do basic attacking and taking damage behaviours, but they’re proving to be more difficult then i thought.


I have animations set up for the attack and take damage behaviours, but im unable to call from them from inside each specifc function in the resource script. Is there any way i could do this besides just having the base node as a parameter in the function to accsess the animationPlayer?

No, resources do not have access to the scene tree and must use a node variable or function parameter.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.