Hello everyone, i have ran into a setback and was looking for help. it seems that Google cant help me with this, so i have come to my #1 reference sight.
I am making a fighter game, like taken. I do not know the most effective way to transfer damage between players, so ill also ask if i am doing that right.
I have four scripts.
CharacterMove.cs
CharacterAttack.cs
CharacterHands.cs
CHaracterBody.cs
CharacterMove - handles user input and base 2d movement of the character.
CharacterAttack - receives inputs from CharacterMove and communicates with the animator. this is also were i plan on programming button combos. wish i haven’t learned yet.
CharacrterBody - will keep track of health, trigger knock up events, and communicate with the GUI.
CharacterHands - is the problem so far, i am trying to communicate with the Attack script to find out how hard the hands hit and what type of attack it is. this proses have proven difficult for me.
this is the problem script. the errors are coming from 22 and 23 ATM.
type = attackScript.curentAttackType;
Damage = attackScript.curentAttackStrength;
using UnityEngine;
using System.Collections;
public class CaracterHands : MonoBehaviour {
//object that hands will not colide with
public GameObject Self;
private int Damage;
private string type;
private CaracterBody EnamyBodyScript;
private CaracterAttack attackScript;
public void OnCollisionEnter(Collision collision){
Debug.Log("Collision Detected");
ColectValues();
EnamyBodyScript = collision.gameObject.GetComponent<CaracterBody>();
attackScript = gameObject.GetComponentInParent<CaracterAttack>();
//EnamyBodyScript.ReciveDamage(attackScript.curentAttackStrength, attackScript.curentAttackType);
//Debug.Log("Obj: " + collision.ToString + ". Has Been Sent Damage: " + attackScript.curentAttackStrength + ". as type: " + attackScript.curentAttackType);
}
void ColectValues(){
type = attackScript.curentAttackType;
Damage = attackScript.curentAttackStrength;
}
}
The Error that is provided for me in the inspector is:
Assets/Scripts/CaracterHands.cs(23,39): error CS1061: Type CaracterAttack' does not contain a definition for
curentAttackStrength’ and no extension method curentAttackStrength' of type
CaracterAttack’ could be found (are you missing a using directive or an assembly reference?)