I am working my way towards the end of my course work but have got a problem with the combat facility which I am having trouble fixing.
I have an error stating that the variable Damage Text Prefab of DamageTextSpawner doesn’t exist anymore.
I can see in the Inspector that the Player and Enemy Damage Text Spawner Damage Text Prefab configuration item is not set.
Dragging the Damage Text Prefab from the Assets Game UI InGame folder is not being accepted when I try to drop it in.
I have checked the DamageText object and cannot see any problem with it so am foxed.
I have a solution which is to do the training again for the combat section but wondered if anyone had a short cut for me.
The Damage Text Prefab appears to be missing a Damage Text component.
I added the DamageText script to the Damage Text prefab and that was accepted by the Damage Text Spawner prefab but now when I play I get the message:
There are 2 event systems in the scene. Please ensure there is always exactly one event system in the scene.
I did a find on all files for Event and did not find any duplicates.
With the game running, go through each GameObject in the heirarchy (as well as the DontDestroyOnLoad) section.
Alternatively, add this to the Start() of PlayerController.cs
foreach (EventSystem eventSystem in FindObjectsOfType<EventSystem>())
{
Debug.Log($"EventSystem found in {eventSystem.gameObject.name}");
}
(You’ll probably have to add using UnityEngine.EventSystems;
)
This will give you a list of all objects that currently have an event system on them.
This topic was automatically closed after 19 hours. New replies are no longer allowed.