Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

BCE0051: Operator '-' cannot be used with a left hand side type of type 'UnityEngine.Collider' and right hand side of type 'String'.

$
0
0
I'm kinda new at this stuff. I thought scripting would be like HTML or something... Anyways, I'm trying to make a simple RPG. To keep from starving, the player must survive on coconuts because I'm too lazy to make other foods. I keep getting the above error... Here's what I got: #pragma strict var Vigor : float = 100.0; var Satiation : float = 100.0; function Start () { } function Update () { Satiation -= Time.deltaTime/8; if(Satiation <= 25){ Vigor -= 0.25; if(Vigor <= 0){ print ("You Failed."); } Vigor = Mathf.Clamp(Vigor, 0.0, 100.0); Satiation = Mathf.Clamp(Satiation, 0.0, 100.0); }} function OnTriggerEnter (other : Collider){ if(other-gameObject.name == ("CoconutCol")&& Satiation <= 90.0){ Vigor += 10; Destroy (other-gameObject.transform.parent.gameObject); } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>