Issue with istance of a custom control

I am having an issue with instances of a custom control sharing variables. Any help is much appreciated.

Can you talk a bit more about the problem? Your attempting to share/receive variables from other controls or other classes?

I have a control for a simple path finding along a grid for a spatial. The control receives a destination and moves the spacial to that destination. The issue is when i have more than one instance of the control they will share the destination variable and probably other variables causing any previously selected spatial’s to move to the last selected destination.

Is the destination variable a Vector3f? Did you try cloning it? I had this problem too and i solved it by cloning the vector3f.

Also… just double checking… but you are adding a different instance of the control to each spatial, right? ie: not just reusing the same control object?

The distance variable is a Vector3f and yes i am adding a different instance to each control. How would i go about cloning the variable? Also i am using a modified CharacterController for my custom control and the issue is solved when i use walkDirection to hold my destination vector. I would of course prefer to use my own variables though.

llewyckyj said:
How would i go about cloning the variable?

Everything in jme that implements "Cloneable" has the "clone()" method, and the Vector3f implements it.
Vector3f destinationClone = destination.clone();

Can you show us the code for the control and the code where you create each one and add them to the spatial?