How can I access a Sprite3D Instance on Mouse Events?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AxDSan
:warning: Old Version Published before Godot 3 was released.

Hello, new to the engine, been trying to get along with the docs and references, but nothing specifically to what I’m looking for… or I haven’t really looked that much…

Basically what I want is to access that sprite information or instance or however you call it here, so I can access its properties, transform, etc., etc.

:bust_in_silhouette: Reply From: eons

Sprite3D is a Node, if it is on the scene tree you can get it with get_node, then use any of the available methods for Sprite3D (and up on the class hierarchy) to do what you need.

ok thank you very much! will try fiddle with that :smiley:

AxDSan | 2017-02-06 16:40

If you look at the docs (web or Godot help), you will see it says Inherits: SpriteBase3D < GeometryInstance < VisualInstance < Spatial < Node < Object.

So, information on some things, like methods to get/set texture or frames will be on Sprite3D but others, like transform, will be on Spatial (you can notice that on the sections at the node inspector too).

eons | 2017-02-06 17:50

thank you very much for helping me out

AxDSan | 2017-02-07 19:59