Hello, I’m having trouble with converting “Int to Float” vice versa. I’m wondering if someone can help me to convert the int to float stats.currentHealth *= multiplier; It is Underlined and in bold text down below.
using System.Collections.Generic;
using UnityEngine;
public class PowerUp : MonoBehaviour {
public float multiplier = 1.5f;
public GameObject pickupEffect;
void OnTriggerEnter (Collider other)
{
if (other.CompareTag("Player"))
{
Pickup(other);
}
}
void Pickup(Collider player)
{
Instantiate(pickupEffect, transform.position, transform.rotation);
CharacterStats stats = player.GetComponent<CharacterStats>();
stats.currentHealth *= multiplier;
Destroy(gameObject);
}