Can someone explain how to use the ClickFX template? I imported the unity package from the downloads page, used the "Apply" button from the template to install it. Now what? Do I put the ClickFX prefab into all my scenes? When I do that I don't see the cursor. Is there anything I need to adjust in the Cursor manager or Settings?
My game uses Touch Screen, Context Sensitive, None (movement method), first person 2D. Unity 2022.3
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It should be automatic.
If the installation was successful, you should find that a "ClickFX Spawner" object is added to your scene's Hierarchy at runtime. This is done via a new event added to the Events Editor.
Is this prefab showing, and is the Event defined? The Events Editor can be found in the Adventure Creator menu in the top toolbar.
Yes it is adding the spawner at runtime and is in the Events Editor. On installation I chose my Game Folder inside the Assets folder. Here's the error in the console on runtime:
NullReferenceException: Object reference not set to an instance of an object
AC.Downloads.ClickFX.ClickFXSpawner.OnHotspotInteract (AC.Hotspot hotspot, AC.Button button) (at Assets/AdventureCreator/Downloads/Click FX/Assets/Scripts/ClickFXSpawner.cs:69)
AC.EventManager.Call_OnInteractHotspot (AC.Hotspot hotspot, AC.Button button) (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:445)
AC.PlayerInteraction.ClickButton (AC.InteractionType _interactionType, System.Int32 selectedCursorID, AC.InvInstance selectedInvInstance, AC.Hotspot clickedHotspot) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:1148)
AC.PlayerInteraction.HandleInteraction (AC.MouseState mouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:812)
AC.PlayerInteraction.ContextSensitiveClick (AC.MouseState mouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:677)
AC.PlayerInteraction.HandleInteractionMenu (AC.MouseState mouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:234)
AC.PlayerInteraction.UpdateInteraction () (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:159)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:248)
So I deleted the ClickFX folder in the downloads folder and that stopped the console error, however I'm still not seeing a cursor. A ClickFX folder is still inside my game folder (in Assets, where I chose to install it on Apply) and the spawner is still appearing at runtime. The Events manager is showing the correct path the Spawn ClickFX action list asset. Any ideas?
Hey Chris hold off for now...I'm diagnosing with a new project and will get back to you.
I was able to get it to work in an empty project so I'm not sure what's happening.
No worries I will stick with my previous cursor.
It's an issue with the template assuming you have a Player character on-screen.
I have updated the package on Downloads with a correction. You'll first need to remove it from your project by deleting the "Click FX" subfolder that the template installed the prefabs to, as well as the Event listed in the Events Editor. Import the new package and re-install it, and it should work. Thanks for letting me know of the issue.
Thanks Chris!