- Home /
How do I make an enemy AI jump?
I am making my Ludum Dare entry and want my AI to try and out run the player to a certain object, however I want the AI to jump. I am totally new to game development and scripting. Here is my script so far, what do I have to add to make the AI jump and can I add it to this script or should I make a new one?
Script:
var target : Transform; var moveSpeed = 3; var rotationSpeed = 3; var myTransform : Transform;
function Awake(){ myTransform = transform; }
function Start(){ target = GameObject.FindWithTag("EndPlatform").transform; }
function Update () { var lookDir = target.position - myTransform.position; lookDir.y = 0;
myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(lookDir), rotationSpeed*Time.deltaTime); myTransform.position += myTransform.forward moveSpeed Time.deltaTime; }
Your answer
Follow this Question
Related Questions
How to make an AI of a car to jump if there is any obstacle 2 Answers
2D Platform AI Jump 1 Answer
2D Jump AI Help 0 Answers
Detecting Collision from top side of 2d box collider 0 Answers
AI Chasing Jumping Char into the Air 2 Answers