FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

FPS KIT (V. 0.1) FROM FPS TUT 6

Share

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
My enemy dont KILL me !!!
HELP
!!!

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
Manish Thakur, if you need any help then please make a new topic in the Help(General) section of the forum.

--New Developer

_________________
Serious, Focused but FUN.

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
Whenever I try and download from this forum the tab opens, loads for a while then either says that the link doesn't exist or the page is temporararily busy???

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
For some reason my camera for zooming in is default for when i start the game, any idea on why?

descriptionMuch Needed!

more_horiz
Thank you i will use some of the rayscript code so that i can see an example so i can update my code!
Great work keep on posting these freebies i hate using the slow unity asset store for unity 4, I will credit you in the credits!

descriptionHow to add animations to the Enemy AI script???

more_horiz
I got this working but I would like an actual enemy like a zombie, that has animations. So instead of the

Code:

renderer.material.color = Color.red;


I would like something like:

Code:


animation.Play("run");


but when I add put that into the script, nothing happens. My enemy doesn't even move toward me.

This is what I change the script to:

Code:

//IMPORTANT NOTE! THIS SCRIPT WAS MADE IN VIDEO NUMBER 21! CHECK OUT THE EARLIER VERSION (NOT V2) IF YOU HAVEN'T REACHED THAT VIDEO.

var Distance;
var Target : Transform;
var lookAtDistance = 25.0;
var chaseRange = 15.0;
var attackRange = 1.5;
var moveSpeed = 5.0;
var Damping = 6.0;
var attackRepeatTime = 1;

var TheDammage = 40;

private var attackTime : float;

var controller : CharacterController;
var gravity : float = 20.0;
private var MoveDirection : Vector3 = Vector3.zero;

function Start ()
{
   attackTime = Time.time;
   animation.Play("idle01");
}

function Update ()
{
   if(RespawnMenuV2.playerIsDead == false)
   {
      Distance = Vector3.Distance(Target.position, transform.position);
      
      if (Distance < lookAtDistance)
      {
         lookAt();
      }
      
      if (Distance > lookAtDistance)
      {
         animation.Play("idle01");
         //renderer.material.color = Color.green;
      }
      
      if (Distance < attackRange)
      {
         animation.Play("attack01");
         //attack();
      }
      else if (Distance < chaseRange)
      {
         animation.Play("run");
         //chase ();
      }
   }
}

function lookAt ()
{
   animation.Play("caution");
   //renderer.material.color = Color.yellow;
   var rotation = Quaternion.LookRotation(Target.position - transform.position);
   transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * Damping);
}

function chase ()
{
   animation.Play("run");
   //renderer.material.color = Color.red;
   
   moveDirection = transform.forward;
   moveDirection *= moveSpeed;
   
   moveDirection.y -= gravity * Time.deltaTime;
   controller.Move(moveDirection * Time.deltaTime);
}

function attack ()
{
   if (Time.time > attackTime)
   {
      Target.SendMessage("ApplyDammage", TheDammage);
      Debug.Log("The Enemy Has Attacked");
      attackTime = Time.time + attackRepeatTime;
   }
}

function ApplyDammage ()
{
   chaseRange += 30;
   moveSpeed += 2;
   lookAtDistance += 40;
}



What am I doing wrong??? I have a animation controller attached to my enemy with all the animations...

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
[You must be registered and logged in to see this link.] wrote:
How come it wont download it?????? Mad Mad Question Question pale pale 


Add Fly Was Shutdown I think, also addblock blocks addfly at times

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
Thanks !

How do you animate the enemy soldier ? (Actually, about the target script...)

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
iT DOESN'T LET ME IMPORT.

descriptionRe: FPS KIT (V. 0.1) FROM FPS TUT 6

more_horiz
I need help!

Assets/Tutorial 5/Tutorial 5/Scripts/Player/RespawnMenuV2.js(6,20): BCE0018: The name 'MouseLook' does not denote a valid type ('not found'). Did you mean 'UnityStandardAssets.Characters.FirstPerson.MouseLook'?

Can anybody help me?
Permissions in this forum:
You cannot reply to topics in this forum