AI crocodile

Hi there, So im creating a VR game inspired by Jumanji Welcome to the Jungle and The Next Level.

5 players

So i want a crocodile, to swim and jump out of the water towards a player that is close by the water, and i want the AI to start when a player enters a triggerzone that runs along the riverbank.

Then “kill the player”(question for another post) And i then want the croc to drag the dead player(ragdoll) back into the water and swim away from the other players and don’t come back.

I tried this with just an animation that activates when he enters the trigger but if he enters the trigger at a place other than where the animation happens, the croc wil miss the player. I don’t want this, i want it to be dynamic, So a player can stand along any location of the riverbank, so the croc wil attack the player at the place he is, so AI is the best option I think I have

The player is on tag Player.

If this seems a little confusing

Please sent me an email at,

We still dont have enough info on your skills, what assets are being used. etc. Though i can say you need to have an AI system in place (asset like Emerald AI or code your own).

Get your self a good AI system :slight_smile:

Well you don’t really need an Ai you just need to make the crocodile move towards the player, this can be accomplished with LookAt() and AddForce(transform.forward); and you can animate/lerp it to make it more smooth, you could also use a vector flowfield, I made an asset for that. but basically you have a grid of circle colliders and they point at a goal, then the alligator’s position would update when it collides with a vector.