Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
var player = ccbGetSceneNodeFromName("Player"); This is what I did. It doesn't work, to put it simply :)... I need a rotatable third person camera for my project. I just can't seem to figure it out... btw this code is to make it update it's position when the character moves. |
||||
|
First off ccbSetSceneNodeProperty needs 3 arguments: ccbSetSceneNodeProperty(sceneNode, propertyName, value) So the code above should be this:
All this will do is set the camera to be inside the player. What you may be able to do another node lets call it "Placeholder" and set it as a child of Player, and position it where you would like the camera to be. Now change the code to this:
Then all you need to do is point the camera's target to the player every frame. I recommend doing all this in a behavior in the onAnimate event. |
|