Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I've got no idea how I would do that |
||||
|
Add a behaviour "when key pressed" (left mouse click) Do action "Shoot" (towards camera target). |
||||
|
I mean like where you can move the mouse around on the screen while the camera is still and shoot from that position |
||||
|
You can probably use the "Get 3D position from 2D position" API to convert the mouse position to a real-worl 3D target. ccbGet3DPosFrom2DPos(x,y) Then use the 3D position as the target for the shoot action. example: var mouseX = ccbGetMousePosX(); var mouseY = ccbGetMousePosY(); var anode = ccbGetSceneNodeFromName("somenode"); var pos3d = ccbGet3DPosFrom2DPos(mouseX, mouseY); ccbSetSceneNodeProperty(anode, "Position", pos3d); |
||||
|
Thanks I'll try this. |
|