Using Movement Pack with Unity's Character Controller

SolarFalcon

New member
If anyone knows how to get the Movement Pack to work with Unity's Character Controller, please help me out here. I really, REALLY, don't want to design a character controller from scratch just to use this movement pack, and I don't have $180 to fork over for Opsive's Ultimate Controller.
 
Ok, I'm a freaking noob. I needed to use the NavMeshAgent's desiredVelocity instead of the Target's position.

While the above did solve that problem, I still have a glaring issue with the movement pack. I have a simple Tree set up with only a Wander action. According to the script file, Wander should run indefinitely, correct? Well, with the default script, it does not loop, no matter what I set its wait time to.

In short it is NOT working. I recently deleted my installation and downloaded it again from the Asset store just to make sure I didn't break something, and it still is not working. Does it need to be set up in some specific way in the Editor?

*I also tried a Repeater->Wander with the repeater set to loop forever.
 
The wander script that you sent me is correct. Wander always returns a status of running which means that it will never return. That looks like what it is doing as well - is there something in particular that you're looking at? You don't need to parent it with a repeater in order for it to run forever.
 
Ok, well I updated Behavior Designer and check this again, now Wander works, but only a few times, then it fails. I thought maybe it wasn't able to find a valid location, so I removed the limit on checking for valid move locations, but that didn't work either.(edit: It actually did work, but it still hangs after 3 moves) I can't figure out why it keeps stopping, when it should loop continuously. For some reason, it hangs and never moves again until the player moves into its line of sight then the other logic kicks in. As before, the only changes I have made are where I add a call to my controller to animate the Enemy character.
 
Last edited:
If destinationReachTime is -1 then it's probably never actually arriving at the destination. Try increasing the arrive distance to see if that helps.
 
I'm having similar issues with wander(A*Star Project version) inside an Utility Selector. Wander appears to work fine on its own, but in a parallel or in a case such as this with the Utility Selector, it "dies out" after about three destinations, slows down and stops responding.

Not sure what would cause it. Though the slowing down has me thinking that it gets a random destination that is within the RichAI slow down distance or the set arrive distance of the RichAI. But the fact that it seems to occur under the above circumstances (in a parallel or in a Utility Selector) belies that some.
 
So it's been a while an I've updated Unity and Behavior Designer. It's really bugging me that this asset is not working for my purposes and I'm still trying to figure out if it's me, Unity, or this asset.

So, I've started with the default code that ships with Behavior Designer and I have NOT tampered with it at all. I changed the UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter.cs so that it will automatically use the NavMeshAgent.desiredVelocity like so:
C#:
private void Update()
        {
            remainingDistance = navAgent.remainingDistance;

            if(navAgent.remainingDistance <= .2f) // If you don't do this, it won't stop moving
            {
                Move(Vector3.zero, false, false);
            }

            else
            {
                Move(navAgent.desiredVelocity, false, false);
            }
        }

This works WAY better than was I was attempting before. That's it for my changes.

Now, what I've done is set up a very simple BehaviorTree on a Humanoid AI Enemy. I have A Repeater->Pursue. Repeater is set to repeat indefinitely and Pursue is set to Speed 5, Arrive Distance 1.3, Update Rotation = false. Prediction values are set at 1 because it seemed the default 20 was way too high and I've tried the default as well, doesn't work either.

What happens:
The AI Enemy moves towards the target (the player in this case), but stops way outside of the range. If the player moves, then the AI enemy starts moving again, but as soon as the Player stops, so does the AI. Even if the NavMeshAgent.remainingDistance > 0.2f it still won't move. There isn't anything else stopping movement, so what is happening?

I've changed many values, tested this over and over. I'm exasperated, and very disappointed.

At this point, I do not believe I'm doing anything incorrectly. I've been trying different things since I last posted and none of them have worked to satisfaction. If you, Justin, would download the Unity Standard Assets Third Person Controller and set this up as I've done, maybe you can find what the problem is.
 
I'd say the issue is likely the Arrive Distance of your Pursue Task. Likely, the AI caharacter is stopping at 1.3f rather than the 0.2f as this setting serves a similar function.
 
I've changed that value to 0 (and other numbers higher etc), and it still doesn't work. I just started another project and I'm using BD there without the Third Person Controller and it's working as intended. Not sure how that script is screwing things up, but that must be the issue. I'll have to handle humanoid animations another way I guess. Thanks for the replies.
 
Top