Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Disabling/enabling collision via scripting doesn't work. var s = ccbGetSceneNodeFromName("cubeMesh1"); this code have to disable the collision for the Cubemesh....but it did not work. also i have physics engine set as physics simulation.. |
||||
|
Also setting the visibility of the scenenode to false is not disabling the collision.. |
||||
|
if you used this script in the editor you must also add this command "editorUpdateAllWindows()". only works with old physics management. |
||||
|
@pmax am not using the script in the editor.. am using it in the game during runtime... @Niko actually the bug appears when we have physics engine set to physics simulation. the code may be working, but there is problem when the physics simulations is turned on... even if the object position changes the collision was still there at the old position of the object..... try the ccb file below... execute it as exe and then go near to the 2 cubes using the arrows keys... then press Spacebar to change the position of the cubemesh... you will notice that the there is still collision occuring... https://drive.google.com/file/d/... while using the physics engine as collision , will remove the collision from the old position, but disabling the collision during runtime is not working in the collision engine too. |
||||
|
So, adding every few seconds do something then,executing this ccbUpdatePhysicsGeometry()will change the position of collision object... it may solve my problem now.. but there must be an option to turn collision on or off during run time and the above code should be applied automatically when the physics engine is changed to physics simulation instead of collision.... |
||||
|
try to see if that's okay I added a script in the root. https://www.dropbox.com/s/9ucyvh... |
||||
|
Yes, that's true, it is a missing feature. |
||||
|
@Pmax you should have read my comment, i have already solved that thing ... All i want is turning collision on and off during runtime... @niko i hope you will make this feature available in the next release... |
|