Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
[BUG?] Deleted Node, Collision Remains

VeganPete
Guest
Quote
2021-04-01 22:47:48

If a scene node has "collision" set, when the scene node is deleted the collision still remains.

For example: if I have a door which blocks entry, when the door is deleted, I still can't walk past it.

As a workaround, I guess I could "move position" of the scene node to way above/beneath the map, out of the way - or maybe reduce its scale to zero instead?

Thanks.


veganpete
Registered User
Quote
2021-04-01 22:51:56

*Same thing happens if I delete an enemy "when shot", the enemy can still attack the player.

It's as if scene nodes aren't really being deleted, just being made invisible instead.

I just noticed, even if I change the scale to zero or try to move it -1000y, it still obstructs my path :/


just_in_case
Moderator
Quote
2021-04-02 04:51:07

If you have physics simulation enabled for your game then this might happen. and easy and quick fix for this problem is to use ccbUpdatePhysicsGeometry( )command on every few seconds. which will update the collision of the object if the position of an object is changed.

now for the enemy part ,if your enemy has a behavior move object by physics attached then the collision might still appear even if you change the position or scale of the enemy.
an easy fix for this is to push the physics object using a force either by colliding with him or by setting a very small amount of velocity to it. using the command ccbSetPhysicsVelocity().

and nope delete command don't make the node invisible it actually removes/delete the scene node, once a node is deleted you no longer can access it through sscbGetSceneNodeFromName() command it will always return that the object not defined or not found error.

hope this will help.



VeganPete
Guest
Quote
2021-04-02 11:41:38

Perfect!

Ahh, I see - yes, it is definitely because of physics simulation - makes sense.

Thank you; it was very confusing, I'll throw an "update geometry" command once the door gets deleted.

On a side note, my game doesn't need to be using the physics feature at all - I just turned it on in the Coppercube options experimentally. I noticed consistently that it gave my game a massive frame-rate boost for some reason - so I left it on.

Thanks a million for all the help. You're a star.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact