Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I'm guessing this would be doable, but I'm not too much of a wizard: I want to have enemies who will follow a path and, when the character is within a certain proximity, he breaks out of that path and chases the character and, when you collide with him, it does a set of actions and respawns you (changes the position of the character). Would I need the C++ code to do something this sophisticated? I'm thinking I could have the enemy run on a path and, on proximity, hide that version and move a different version of the enemy who is OOB (so he can't target the player) to the position of the path-following version. |
||||
|
Well... As for making enemy follow a path, you can use the existing behavior of Game Actor (With AI, Player, Health etc...) and set the first property as "Follow a Path" but it won't terminate the path, won't shoot you and even chases you... So that behavior is useless... I will answer you whenever I found the solution... |
||||
|
Maybe something like this can work.. Use the behavior game actoe with health and ai to follow a path and also add an on proximity behavior to the player... And execute a javscript code on proximity... Var enemy = ccbGetSceneNodeFromName("enemy"); CcbAiCommand(enemy,"Cancel") CcbSetCoppercubeVariable("follow",1); Something like the above code should be executed... Now add another behavior every few seconds do something then if a variable has a value... Varianle name = "follow" Value =1 Action to execute will change position on a scenenode, position type should set relative to a scenenode and then change which scenenode should be enemy and relative to which scenenode should be player... So that it will follow thw player once it stops following path.. For cheking the collision you can add another proximity behavior the radius of this proximity sphere and then you can execute another action to respawn your character... Hope that works...😊 |
||||
|
|
|