I’m aware this question has been asked multiple times but the answers I’ve seen are for JS or aren’t applicable.
I’m trying to call the BiteAttack function from this script
using UnityEngine;
using System.Collections;
public class PhysicalAttacks : MonoBehaviour {
public GameObject enemy;
public int enemyHealth;
public int enemyMana;
public int enemyStamina;
public Vector3 startPosition;
void Start ()
{
enemyHealth = enemy.GetComponent<CharacterStats> ().charHealth;
enemyMana = enemy.GetComponent<CharacterStats> ().charMana;
enemyStamina = enemy.GetComponent<CharacterStats> ().charStamina;
startPosition = gameObject.transform.position;
}
void ResetCharacter ()
{
gameObject.transform.position = startPosition;
}
void BiteAttack ()
{
gameObject.transform.position = enemy.transform.position;
enemyHealth = enemyHealth - 5;
ResetCharacter ();
}
}
in this script
using UnityEngine;
using System.Collections;
public class WolfBehaviour : MonoBehaviour {
public int waitTime;
public GameObject controllerObject;
void Start ()
{
waitTime = 200 - gameObject.GetComponent<CharacterStats> ().charSpeed;
}
void AttackState ()
{
controllerObject.GetComponent<PhysicalAttacks> ().BiteAttack;
}
}
but unity says that only assignment, call and increment/decrement etc etc can be used as a statement.
from what I’ve seen this is the correct way to call a function so I cant work out what’s going wrong.
knowing me I’ve probably made a spelling mistake somewhere or something small and stupid.