Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'au fps kit v1.5'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 1 result

  1. help me to fix that error SendMessage ApplyDamage has no receiver! UnityEngine.Component:SendMessage(String, Object) NewZombieAI:Update() (at Assets/New folder (9)/NewZombieAI.cs:83) This is my NewZombie cs File using UnityEngine; using System.Collections; public class NewZombieAI : MonoBehaviour { Transform target; //the enemy's target public float moveSpeed= 3; //move speed public float rotationSpeed= 3; //speed of turning public float attackRange= 3; // distance within which to attack public float chaseRange= 10; // distance within which to start chasing public float giveUpRange= 20; // distance beyond which AI gives up public float attackRepeatTime = 1.5f; // delay between attacks when within range public GameObject anim; public float maximumHitPoints= 5.0f; public float hitPoints= 5.0f; public GameObject Zombie_New; //public Transform AudioClip attack; private bool chasing= false; private float attackTime; bool checkRay = false; public string idleAnim = "idle"; public string walkAnim = "walk"; public string attackAnim = "attack"; int dontComeCloserRange = 2; private Transform myTransform; //current transform data of this enemy void Awake (){ myTransform = transform; //cache transform data for easy access/preformance ///zombie_New.anim.GetComponent.<Animation>().wrapMode = WrapMode.Loop; Zombie_New.GetComponent<Animation> (). wrapMode = WrapMode.Loop; Zombie_New.GetComponent<Animation> ().wrapMode = WrapMode.Once; //anim.GetComponent.<Animation>()[attackAnim].wrapMode = WrapMode.Once; Zombie_New.GetComponent<Animation> ()[attackAnim].layer = 2; //anim.GetComponent.<Animation>()[attackAnim].layer = 2; //anim.GetComponent.<Animation>().Stop(); Zombie_New.GetComponent<Animation> ().Stop(); } void Start (){ target = GameObject.FindWithTag("Player").transform; } void Update (){ // check distance to target every frame: float distance = (target.position - myTransform.position).magnitude; if (distance < dontComeCloserRange){ moveSpeed = 0; //anim.GetComponent.<Animation>()[idleAnim]; Zombie_New.GetComponent<Animation> ().Play(idleAnim); //anim.GetComponent.<Animation>().CrossFade(idleAnim); Zombie_New.GetComponent<Animation> ().CrossFade(idleAnim); }else{ moveSpeed = Random.Range(2, 3); //anim.GetComponent.<Animation>().CrossFade(walkAnim); Zombie_New.GetComponent<Animation> ().CrossFade(walkAnim); } if (chasing) { //move towards the player myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime; //rotate to look at the player myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime); transform.eulerAngles = new Vector3(0.0f, transform.eulerAngles.y, 0.0f); // give up, if too far away from target: if (distance > giveUpRange) { chasing = false; } // attack, if close enough, and if time is OK: if (distance < attackRange && Time.time > attackTime) { //anim.GetComponent.<Animation>()[attackAnim].speed = 4.0f; Zombie_New.GetComponent<Animation> ()[attackAnim].speed = 1.0f; //anim.GetComponent.<Animation>().CrossFade(attackAnim); Zombie_New.GetComponent<Animation> ().CrossFade(attackAnim); target.SendMessage( "ApplyDamage", maximumHitPoints); attackTime = Time.time + attackRepeatTime; //GetComponent.<AudioSource>().PlayOneShot(attack, 1.0f / GetComponent.<AudioSource>().volume); } } else { // not currently chasing. //anim.GetComponent.<Animation>() [idleAnim].speed = 4; Zombie_New.GetComponent<Animation> ()[idleAnim].speed = 4; //anim.GetComponent.<Animation>().CrossFade(idleAnim); Zombie_New.GetComponent<Animation> ().CrossFade(idleAnim); // start chasing if target comes close enough if (distance < chaseRange) { chasing = true; } } } void OnDrawGizmosSelected (){ Gizmos.color = Color.yellow; Gizmos.DrawWireSphere (transform.position, attackRange); Gizmos.color = Color.red; Gizmos.DrawWireSphere (transform.position, chaseRange); } } NewZombieAI.cs
×
×
  • Create New...