Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
So... 1: How to make a Lock On system? 2: How to make a health bar? 3: How to make actor finish their animation? For some reason when my character walk out of the enemy attack range while the enemy is attacking they cancelled their animation and then they follow me until im in range again then they do the attack animation again. And when my character doing attack or dead animation, if i press a movement key the animation will get overwritten and my character return to his normal animation. 4:Set animation to a specific area? i add an action that when you press the button you will do an animation in a specific spot and i used move by a vector but the character wont move to that area. I know this is a dumb question but i dont have time to think. And im new to javascript so if i need to add javascript please give me a reference. Thank you. |
||||
|
Not sure what a lock on system is? About a health bar: see this thread: http://www.ambiera.com/forum.php... Not sure about that animation. If you are dead, you shouldn't be able to move anymore, no? What behavior is it you are using? |
||||
|
It's kinda like the Dark Souls Lock-on system when you lock the target you will alway face torwards the enemy like a duel or something. And about health bar, can 2d image overlap eachother? My idea is to set a variable so that when the enemy take damage there will be a transparent 2d image go and hide part of the health. And when the variable equal 0 the enemy will play a death animation, give player money and disappear. |
||||
|
1: How to make a Lock On system? http://necromanthus.com/Test/htm... Get close to the dog and see its behaviour. So in this case it's about dog.lookAt(camera) Obviously, the inverted behaviour is camera.lookAt(enemy) That's what you need. Just study the source of this demo and you'll figure out what to do. |
||||
|
Cameras don't lootAt anything, to properly orient a camera you have to edit its "Traget" via Javascript Api You need to use an "every few seconds do something" behavior set t a low value like 10 then execute this javascript: var targetNode = ccbGetSceneNodeFromName("cubeMesh1"); Of course replace cubeMesh1 and Camera1 with the appropriate scene node names. |
||||
|
Cameras don't lootAt anything, That's a FALSE statement. In any decent 3D engine: node1.lookAt( node2 ) Where the nodes can be cameras, lights, meshes, groups, ... almost everything. p.s. All the noobs are game developers these days ... |
||||
|
And a tip for Niko and his CC development: (node1 front direction) lookAt (node2 position) As I said before, this is available in any decent 3D engine. |
||||
|
wrote: Cameras don't lootAt anything, That's a FALSE statement. In any decent 3D engine: node1.lookAt( node2 ) Where the nodes can be cameras, lights, meshes, groups, ... almost everything. Its TRUE for CopperCube. Weather that is how other engines do it or not, "node1.lookAt( node2 )" is NOT currently how cameras (or any scene node) work in CC. As per the current documentation, there is no single method to have a camera simply look at a scene node via the Javascript API. The easiest solution would be to copy the position of the node and set the camera's target to that value. As per the code I submitted above. |
|