- Home /
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, InfoZerogstudios@gmail.com
Answer by warthos3399 · Jan 23, 2020 at 01:13 AM
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 :)
Answer by logicandchaos · Jan 23, 2020 at 01:27 AM
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.
Your answer
Follow this Question
Related Questions
Editing a local variables position 1 Answer
Unity Crashing From Script 0 Answers
Gun not smoothly following player,How to make gun smoothly follow player 1 Answer
How to add player on road spawn script 1 Answer
2d scene into 3D scene, 0 Answers