≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
If I need to make an AI, how do I check if I hit it?
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: Okay, I was able to make enemy follow player everytime, but the attack doesn't work, I guess. I tried to do this in the behavior: [code]var posT = ccbGetSceneNodeProperty (this.ToAttack, "Position"); var pos = ccbGetSceneNodeProperty (node, "Position"); var vector = new vector3d (posT.x - pos.x, 0, posT.z - pos.z); var dist = vector.getLength(); if (dist <= 10) { ccbAICommand (node, "attack", this.ToAttack); } else { ccbAICommand (node, "moveto", new vector3d (posT.x, pos.y, posT.z)); };[/code] My only idea is that enemy can't hurt me because he tries to attack every frame, so, he can't land a single hit in this short time. Am I... Right?[/quote]
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