View Single Post
  #2  
Old 07-29-2015, 04:39 AM
mape2k mape2k is offline
Member
 
Join Date: Mar 2013
Posts: 60
One solution would be to avoid linking the sensor and the 3d node.

When you create a sensor, you can specify a 3d node as its source. This way, you can make the 3d node disappear by calling the source of the activated sensor and let it disappear

Below is a small example:

Code:
# create ball and sensor
ball = vizshape.addSphere(radius = 10)
ballSensor = vizproximity.Sensor(vizproximity.CircleArea(10),source=ball)


# wait for sensor to be activated, can be a list of sensors
enteredSensor = yield vizproximity.waitEnter(ballSensor)

# get 3d node of ball and let it disappear
ball = enteredSensor.sensor.getSource()
ball._node.visible(viz.OFF)

Last edited by mape2k; 07-29-2015 at 04:44 AM.
Reply With Quote