Picker Issue

I’m using a CollisionTraverser to pick an object with the mouse. When I select that object, I can change its texture and perform other operations directly on the object I get from the event. (entry.getIntoNodePahth())

However, when I try to compare the object I get from the event to my array of models, I can’t find it.

I try setTag(‘id’, str(someNumber)), and calling getTag from the event object yields no tag.

I also try if eventNodePath == nodePaths[n] and get no matches.

What am I doing wrong?

Maybe you could try getNetTag
(this will traverse up until it find the related tag, so if your collision node is a child node of the node you applied your tag on , it will still detect it)

That works beautifully! Thanks.

So does this mean that when collision detection finds a node, it doesn’t produce the same node, but a new copy of that node further down in the tree? Why would they implement it that way?

The collision detection returns the actual geometry node–a GeomNode. But this is probably a child node of the thing that you consider the “object”, which may contain several GeomNodes and other nodes. You can do object.ls() to list the entire hierarchy of your object.