Quantcast
Channel: Latest Questions by honikun
Viewing all articles
Browse latest Browse all 49

Problem with adding number of Potions

$
0
0
I have a script to when i pickup the gameobjet with this script, it add 1 potion to my player, but i don't know why, it's adding 2 potions no matter how i change the value, it add always 2. using UnityEngine; using System.Collections; public class PotionPickup : MonoBehaviour { public int potionUp = 1; void Start(){ } void OnTriggerEnter (Collider other) { if (!other.CompareTag("Player")) return; FireButton.potion += potionUp; Destroy (gameObject); } } I don't know why but it is multiplying the value, if i set potionUp to 3, it give me 6,12,18.

Viewing all articles
Browse latest Browse all 49

Trending Articles



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