Enemy Set Up

Aim_har27

New member
Hello,

I have the Ultimate Character Controller and nothing else e.g. Behavior Designer..

I am looking to create a Enemy Character that follows and damages my player when touched by attack animation. Is this possible to achieve the basics with the UCC and use something like PlayMaker. If so what's the basics starting point? I would really appreciate someone's help with this one.

Thank you in advance to those of you that reply.

Kindest regards,

Aimee
 
I'm not familiar with PlayMaker, but the basic starting point would be:

- NavMeshAgent on the enemy character
- NavMeshAgentMovement ability on the enemy character
- Use NavMeshAgentMovement.SetDestination to set the enemy character's destination point to the player's current position
- Repeat SetDestination every so often to make the enemy character repeatedly move towards the character's current position
 
Hello,
Thank you for your reply, I can't seem to figure it out. Are there any screenshots or a demo out there I can have a look at?
I have opened up the opsive menu, created a new character, made sure Nav mesh is included etc...
 
Not for this specific case with PlayMaker, however here's the general idea in code, maybe you can work out how it translates:

C#:
void Awake() {
    locomotion = characterObject.GetComponent<UltimateCharacterLocomotion>(); // first get a reference to the character's UltimateCharacterLocomotion component
    navMeshAgentMovement = locomotion.GetAbility<NavMeshAgentMovement>(); // then get a reference to the NavMeshAgentMovement ability
}

...
    
void Update() {
    if (navMeshAgentMovement.SetDestination(characterObject.transform.position)) {
        // the destination was set succesfully
    } else {
        // the destination was not able to be set
    }
}

This is much simplified of course, e.g. you wouldn't want to call SetDestination every single frame, but it should be a good starting point.
 
Hello,
Thank you Andrew, I am getting the below error with the script;

Assets\Opsive\UltimateCharacterController\Scripts\Character\SetDestination.cs(18,67): error CS0246: The type or namespace name 'NavMeshAgentMovement' could not be found (are you missing a using directive or an assembly reference?)
 
Top