i need help!!!

so im making survival fps game
i need fish AI script i have models of sharks, whales, etc… with ofcourse animations
how to make shark to swim in water so do i need bake scene or?
and i have advanced ai pro when i add script to shark and do options “waypoints, animation set, target and etc”
on baked scene my shark go out of terrain and staying in place with “walk” anim.
so if anybody can help me :slight_smile:

I don’t know anything about this Advanced AI Pro.
But is there a possibility you still need to do a Vectro3.forward? That way the Shark knows to move forward (towards) this waypoint.

Again, I could be totally wrong as I don’t know how that AI system works.

hmm, can you… if you want to send me a link of other ai asset with waypoints and agressive :slight_smile:
and one more question if ai have way points do i need navmesh scene ?

Honestly, all i can say is just search the Asset Store. I don’t really purchase AI stuff. I just make my own.
I find it easier, at least for the sake of what I want to do lol.

The easiest way to do your own way points is to put some empty game objects around the map, and tell your Shark to go to it.

something like. (MAY OR MAY NOT WORK) - NOT TESTED.

public GameObject[] Waypoints;
public float Speed;

void Update(){
foreach(GameObject wayP in Waypoints){
this.transform.LookAt(Waypoints)
transform.Translate Vector3.forward * Speed * Time.delaTime;
}

}

tnx for answering
so i was on youtube and looking for fish ai and i found speedtutor channel one with fish ai tutorial xD
so this is his js

#pragma strict

var target : Transform[];
var isMoving : boolean = false;

var speed : float = 5.0f;

private var newTarget : Transform;

function Start()
{
    animation.Play("loop_swim");
    animation["loop_swim"].wrapMode = WrapMode.Loop;
    animation["loop_swim"].speed = 2;
}  

function Update()
{
    if(isMoving == false)
    {
        newTarget = target[Random.Range(0, target.length)];
        isMoving = true;
    }  
  
    transform.position = Vector3.MoveTowards(transform.position, newTarget.position, speed * Time.deltaTime);
    transform.LookAt(newTarget.position);
  
    if(transform.position == newTarget.position)
    {
        isMoving = false;
    }  
}

i just wondering do i need bake scene and i dont need lol
shark move to box “waypoints” so i need find that ai can go to waypoints if ai see player attack when player escape return to waypoints or if player die return to waypoints :smile:

so anybody want help me?

I’m not really clear on what you mean but maybe this might help? http://docs.unity3d.com/Manual/Navigation.html

im not good in scripting im good at modeling and etc. so i need script that “shark” go to waypoints when he see player, stop waypoints, attack player, if shark kill player , return to waypoints

anybody?

This forum is more about learning, not many people will write scripts for you here. using a navmesh doesn’t require a huge amount of scripting. There’s good examples of how to set it up in this project http://unity3d.com/learn/tutorials/projects/survival-shooter and you can check for more tutorials on it here Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

i will look tnx

1 Like