|
Post by bowstock on Apr 20, 2023 4:04:04 GMT
So, normally all I do is reference my scripts by calling the class but invector will not let me reference any of their scripts. This is kind of a big deal since I have game mechanics and scripts that are unique to only this project, and I need to reference my third person script to make this work. I am fairly new, so if anybody know how to help I would be thankful. my code is as follows.
void OnTriggerEnter(Collider other) { if (TriggerCondictions(other)) { if (attackObject != null) { attackObject.OnHit(this, other); } }
if (other.tag == "Enemy") { other.GetComponent<MyEnemy>().TakeDamage(20); }
if (other.tag == "Player") { other.GetComponent<vThirdPersonController> ().TakeDamage(20); } }
This works for MyEnemy script, and since vThirdPersonController is the public class for it's script this should work but it does not.
|
|