sebasfreelance
New member
Hi, I am using ULTIMATE CHARACTER CONTROLLER, I would like to activate a weapon by script, if my weapon is active I select an item (weapon) from the inventory of the ULTIMATE CHARACTER CONTROLLER,
can you help me?
I have looked in the help, and tried to use the script that comes from example, equip and use, but I have not got anything ...
I would like to do something like this, can you guide me?
using UnityEngine;
public class TPCInventory : MonoBehaviour
{
[Header("Weapons")]
[SerializeField]
private GameObject Revolver;
void Update()
{
// activa Knife del FPS Weapons
if (Revolver.activeInHierarchy == true)
{
equip a weapon from inventory?
}
// activa !Unarmed del FPS Weapons
else if (Revolver.activeInHierarchy == false)
{
deactivate the inventory weapon?
}
}
}
Thanks!
can you help me?
I have looked in the help, and tried to use the script that comes from example, equip and use, but I have not got anything ...
I would like to do something like this, can you guide me?
using UnityEngine;
public class TPCInventory : MonoBehaviour
{
[Header("Weapons")]
[SerializeField]
private GameObject Revolver;
void Update()
{
// activa Knife del FPS Weapons
if (Revolver.activeInHierarchy == true)
{
equip a weapon from inventory?
}
// activa !Unarmed del FPS Weapons
else if (Revolver.activeInHierarchy == false)
{
deactivate the inventory weapon?
}
}
}
Thanks!