Custom node updates

Hello. I'm fairly new to JME so I'm not sure whether or not I'm solving this problem correctly, but perhaps someone here can help.



I'm working on a set of higher-level classes for my game/engine, based on JME. Specifically, I have a GameObject descended from Node which, among other things, will have an attached emitted sound.



What I want to do now is to move the sound with the object which the node represents. In the future, I may want to attach game logic to the nodes.



I'm confused about where to put this code, though. Is there a method called once/frame which I could use to, say, move a node's attached sample along with it, change its velocity to that of the node, etc.? Or is there some other mechanism for doing this?



Thanks.

There is a new simple sound system around that makes these sound positioning things very easy (see this thread).



In general you should attach a Controller to a Spatial if you want code executed each frame. You don’t need to subclass Node for this (but you can, of course). if you are subclassing Node (or another Spatial) you can also override different methods in there (e.g. updateGeometricState) but I would not recommend that.