|
macaan, Newbie
Posted: 12 September 2012 08:21 AM Total Posts: 30
Hi, i’m wondering what is the best way to temporally remove a rigidBody/vehicle from the physics.
I need to change from one to two cars on track. and if i do
physicsWorld.removeRigidbody(car.carbody)
and then want to add it back the car isn’t handled by physics. Do i have to create a whole new car?
The same problem if i try removeVehicle(car)
|
macaan, Newbie
Posted: 12 September 2012 10:47 AM Total Posts: 30
[ # 1 ]
Don’t get it, but for the moment i worked around this issue, the car is invisible placed beside the track while it’s not needed. But i think there must be another way…
|
loth, Sr. Member
Posted: 13 September 2012 06:55 AM Total Posts: 236
[ # 2 ]
hello yes you can remove car
physicsWorld.removeVehicle(_cars[n]);
carsBoby[n].clearForces();
physicsWorld.removeRigidBody(_carsBoby[n]);
|
macaan, Newbie
Posted: 13 September 2012 07:27 AM Total Posts: 30
[ # 3 ]
thanks, but the removing worked for me. I can’t add it back to the scene without creating a new car. and thats not the way i want it to do
|