Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I have a on proximity behavior for a flat plane, and every time I want to move an camera to the same x,y but different z location, it shoots the player camera up in the air. Either with "change position of a scene node" or action "Move Position" from CC's documentation. Any way to fix the camera being shot up into the air? I think what the code is trying to do is place the camera at a position relative to the orientation and rotation of the camera, which ends up saying that x is up instead of an absolute world value to the side. |
||||
|
Make sure you're setting the camera's target after moving it. |
||||
|
Hi, there you probably need a custom extension for that if your camera has collision enabled and if you are trying to change its position. It might do a random skydive or weird placement due to collision with the other nodes in your scene. The inbuilt actions don't change the position without collision, I will add an option in there for future updates that there will be a checkbox that will allow you to change position without collision from the actions as well. try using the command ccbSetSceneNodePositionWithoutCollision() Here is the example code from the documentation, just make necessary changes to the code as per your need for example node name, and position you want to change.
Note:- This code will be of no help if you have the physics simulation turned ON, you can either wait for an update or use my Custom Launcher to make it work with the physics simulations turned ON. I hope this is what is causing your camera to do a skydive from a random position and will help you fix the issue. ![]() |
||||
|
What if I want to place the camera scene node without collision relative to the camera's current position??? |
||||
|
You can use the javascript for that to get the position of the camera and then adjust it with the above code. So the code should be something like this if you are using the Active Camera.
the above code will set the active camera to +10 units on each X, Y, and Z position relative to its current position. |
|