Hi guys,
I'm new to the AC so I started with the AC Primer Video, but directly at the first hotspot I started banging my head against the wall :-( . For some reason I just cant make the Hotspot work to be clickable.
Im building on Unity latest version 21.3.16.f1 and latest AC version. Im Building for IOS.
I loaded the AC over a Project I already startet.
Scene and Inspector of the Hotspot look like this:
I deactivated my default event system and let the AC event system active.
My UI buttons are working. The only Console Error is that "PlayerStart 'PlayerStart2D' has no Camera On Start"
The debug logger says this:
-> AC debug logger
#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
#3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
Thanks for any help.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
PS: oh... I think i understand why it may not be working. Since I wanted hotspots to be detected when holding a finger on the screen I choose "Hotspot detection: CustomScript"
Changing that to mouse over solved that problem. But I noticed that pick hotspot to start interaction requires me to click once to choose the hotspot and then again to open the action options. Is there a way to see the action options right away on a hotspot with just one click (on IOS / Touchscreen build?)
Welcome to the community, @Robjbo.
Just to be clear: you're referring to the Interaction menu that displays the various Interactions available for a Hotspot?
I'll attempt a recreation. Can you share a shot of your Settings Manager? That'll help me to run a test with the same settings as you.
This will appear if you have no "Default Camera" assigned in the Scene Manager. It can technically be ignored, if you wish to keep the MainCamera stationary the whole time, but it's typically best to create a new GameCamera and assign it.
This GameCamera can be placed in the same position as your scene's MainCamera if you wish for things to look as they are now - the MainCamera will "attach" itself to the scene's default GameCamera, and can then be switched to other cameras later using AC's "Camera: Switch" Action.
Hi!
yes im refering to the interaction menu. I would like to open the interaction menu on the first click. Right now it is still setup that I need to click once to see the name, then again to see the interaction menu.
Sure, see the images here to find the settings:
https://imgur.com/a/h0WsnTT
While at it I also have these errors now, but I can open a separate Threat, if thats prefered.
(1) A local EventSystem object was found in the scene. This will override the one created by AC, and may cause problems. A custom EventSystem prefab can be assigned in the Menu Manager.
--> Is there a Tutorial for that? I can't seem to get my EventSystem in there. And I don't know what is "Use Adressables for UI prefab references" - should I mark that? but then another error shows up: The "AddressablelsPresent" preprocessor define must be declared in the Player Settings ... should I do that?
(2) My game is running in 9:16 or 1536x2732 px. The Interactions Icons seem very very small and although I found the Interaction Menu for the settings, I can't seem to get them bigger. Is there somewhere a comprehensive tutorial for implementing custom made UI in AC? What I found so far has not been working for me.
(3) Once I setup the new created GameCamera 2D as Default Camera in the scene menu all objects including the background turn black in my game..? When I switch it back to "none" everything works fine again.
Edit:
I can see in the preview menu inside the scene view that the GameCamera2D does not see anything, whereas my Main Camera sees everything. I have set both settings to be exactly the same, see images, still it does not seem to work. https://imgur.com/a/NuDn9Fh
Edit2: I saw that the position Z value of the GameCamera2D was not set to -10. I did now set it to -10 and I can see everything for 5 seconds or so before everything turns back to be black again...
I have not changed anything but new errors keep popping up...Maybe this error has something to do with it?...
null texture passed to GUI.DrawTexture
#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
#3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
When I delete the GameCamera 2D everything works fine again, although the error persists...
Thanks for the details. It should just be a case of unchecking Activate Hotspots with double-tap? in the Settings Manager's "Touch-screen settings" section.
A custom EventSystem prefab can be assigned at the top of the Menu Manager. Though if you have your own in the scene by intent, the warning can be ignored.
AC can rely on Unity's Addressables system for better memory management when spawning objects - in this case, UI prefabs asssigned in the Menu Manager. It's not a necessary step, but can help to improve startup times.
Before AC can provide this, however, you need to add the preprocessor define to Unity's Project -> Player settings. This is necessary because it tells AC that it's "safe" to compile code related to the Addressables system, otherwise you'd get compilation errors if the Addressables package wasn't present in your project.
Each of AC's default Menus have a Unity UI counterpart - just switch its Source property to Unity Ui Prefab if it's not already. The linked UI prefab is then listed in the Menu's Linked Canvas prefab field.
When a Menu relies on Unity UI, however, AC won't control the size of it. Instead, it defers to Unity's own UI scaling tools - i.e. the Canvas Scaler component on the UI prefab's root. That'll be what to focus on if the UI doesn't appear correct at your given resolution.
As for tutorials - I don't know what you've found already, but a text tutorial for creating one from scratch can be found here. The creation of a Unity UI-based Menu is also covered in video form as part of the First Person Primer tutorial here.
If you'd like to share images of what you've gotten so far, I can give more specific advice.
When a GameCamera is "made active", the MainCamera will attach itself to it by copying its Transform values each frame. If you transition to another, then the MainCamera will interpolate between the two during this time. It's a bit similar to Cinemachine, if you're familiar with it.
If you select the MainCamera and GameCamera in the Hierarchy and keep the Scene window open, try to see if either of them are moving unexpectedly. How do their Inspector values compare with runtime vs edit mode?
The error doesn't look to reveal too much - is that the whole message?