i am making a gale that is gonna consist of a battle system unlike any other. but i have to start at the beginning to even start making it into what i want it, and the beginning is a little more complicated than i originally intended.
i started my scripting already on making the random battles happen, but for my first problem i keep getting this error:
Assets/FPS RPG_Scripts/RandomEncounterScript.cs(21,17): error CS0029: Cannot implicitly convert type ‘float’ to ‘bool’
with this code:
using UnityEngine;
using System.Collections;
public class RandomEncounterScript : MonoBehaviour {
private int RN;
public bool randEncounter;
public bool inBattle;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
RN = Random.Range(1, 10);
if (Input.GetAxis("L_U D")){
if(RN > 4){
if(RN < 7){
Debug.Log ("battle");
}
}
}
}
}
and my second problem. this is going to load another level called battle or something and after the battle is finished i want to have my character resume from the exact same spot as before the random battle occured. how can i cache or store the player coordinates on the map that it was on before the battle?
now it says Operator
– WhipJr!=' cannot be applied to operands of typestring' and `int'