Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Move AI to Player

Zoo
Guest
Quote
2017-03-26 23:42:59

For some reason, when I run this code the AI keeps walking to my starting position. The new position does not update, it should walk towards my character? @Niko @niko

setInterval(function()
{

var s = ccbGetSceneNodeFromName("Camera1");
var position = ccbGetSceneNodeProperty(s, "Position");
//alert("The cube is at " + position[0]);

var s = ccbGetSceneNodeFromName('Zombie1');
ccbAICommand(s, 'moveto', new vector3d(position[0], position[1],
position[2]));

}, 1000);


Zoo
Guest
Quote
2017-03-27 12:41:38

Resolved...

http://www.ambiera.com/forum.php?t=5093


crackyourspeaker
Registered User
Quote
2017-03-29 03:11:43

Awesome, Idk code at all so this will help in the future, thanks for sharing


Create reply:


Posted by: (you are not logged in)


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


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






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