Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Move Node "without collision"?

Registered User
2021-04-12 09:43:04

I'm trying to move my player from one room to another (in the same scene) when he walks near a door.

The proximity event is being triggered correctly (the screen fades out and back in as room 1 is hidden and room 2 is unhidden), but for some reason the player is not moving - and I can see that it's colliding with the walls of the invisible room when I walk around (could be something to do with physics being turned on?).

Here's what I'm trying to do (on enters proximity to door)....

var p = ccbGetSceneNodeFromName("PlayerModel");
ccbSetSceneNodePositionWithoutCollision(p, 170.773453, -1.723588, -155.198059);

I've also tried adding an "update geometry" before (and after) the "set position without collision" - this fixed a different problem of deleted items still colliding - but it doesn't seem to work for this problem.

How can I move the scene node (with physics simulation turned on), to the newly "unhidden" room, without the node colliding with the old "hidden" room?

As a workaround, I had tried to make a new scene for each room (but that introduced a different set of problems which I couldn't solve). Kinda stuck on this now.

I suppose a last-resort, I could turn the physics simulation off unless someone can think of a better solution please?.

Thanks :)

2021-04-12 16:10:08

Instead of hiding and unhiding scenenode you can change scale to zero and back again to original scale..
If that can help as you are alrwady using the ccbUpdatePhysicsGeometry () command . I would recommend you to use it with every few seconds behavior.

Try it if it can work, if you don't want to change the scale, you can try changing the he position of the scenenode as well.

Hope that helps

Registered User
2021-04-13 09:38:16

Thanks! Scaling is a good idea - the only problem I can forsee is that the scene node is a "room", so if I scale it to zero (so the player can pass through the wall), the player will also fall through the floor into space.

If I scale both rooms instantly (to prevent the player falling through the floor), I think I'd still have the problem of not being able to pass the player model through the walls.

I guess as a workaround, I can try adding a separate collision plane to stop the playerfalling while I scale rooms. I can fade the screen in and out so the scaling is not visible.

Thanks for the idea. I'll have a play around with it; I reckon it will work.

Registered User
2022-11-23 14:20:13

@veganpete could it be done with cloning and deleting the old one (?), just an idea...

2022-11-23 22:04:58

Thanks! Yes, I think that would probably work - I can't actually remember if I fixed it or not but it's always good to come back to threads to grab new info for when I go back to it or encounter something similar in the future. Thank you!

Create reply:

Posted by: (you are not logged in)

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




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



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