I am following the First-person Primer tutorial YouTube video.
When you create the hotspot for the whiteboard, a yellow box appears. However, when I create a hotspot for an object in my game, no yellow box appears.
I have tried to create a hotspot, either from the hierarchy, the hotspot button in the AC Game Controller, or even directly on an object in the inspector. I am not able to see the yellow hotspot box at all.
The hotspot also doesn't work in the game scene either. So when I drag my cursor over the object where the hotspot should be, nothing happens.
Please assist me with this issue, thank you!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
For a Hotspot to be interactive, it requires a Collider component of the type that matches the game's perspective. In a 3D, first-person game, this means either a Box, Sphere, Capsule, or Mesh Collider.
Does your Hotspot object have one of these types, or is it using a 2D Collider instead?
Does the Hotspot show up in your Hierarchy?
"when I drag my cursor over the object" sounds like you are not in First Person mode, is the Game Setup correctly as a 3D First Person Game?
Can you go through the Adventure Creator Tab -> Getting Started -> New Game Wizard and set it up with 3D -> First Person -> Mouse and Keyboard -> Context Sensitive.
You can also leave the check on the 3D Sample Scene right there, so you have a ready scene to test in.
(If this doesn't get setup automatically:)
Open up that Game which should have its own Folder and the corresponding Manager Package in its root, so it has all the right AC Managers Setup.
And then try to add a Hotspot again?
Just to try out if it works, you can delete that new Game Folder later.
If none of that works:
Have you tried to create a new Project with only AC and set it up as a First Person Game and see how it behaves there?
ChrisIceBox
Yes, my objects have mesh colliders. None of them produces a yellow box when I add the hotspot to them in the inspector.
When I open the 3D sample scene,
I do not see the yellow box either.
However, when I hover over and click on an object, the hotspots respond.
The yellow box is only drawn when using a Box Collider - it won't show for a Mesh Collider. That doesn't prevent it from being interactive, however - it's just a visual indicator when designing.
Is your object on the Default layer? The presence of a collider and being on this layer are the two requirements for a Hotspot to be interactive.
If you can share screenshots of your Hotspot / settings, I will see if I can spot the issue.
Sorry to jump into the conversation, but I remember something similar happened to me when I was beginning to use AC. It turned out I had the entities disabled in the Editor view. Be sure you can see them there by enabling the right option.
https://imgur.com/a/7VrYyyn
Alatriste !!!
Thank you, this solved the invisible yellow box issue!!!!!
However, when I move the first-person cursor over the object's hotspot, nothing happens. I think I need to do something to the cursor.
I am also using the 9 verbs interface. Maybe the mouse isn't registering the hotspot because of a 9-verb interface setting. hmmm
Thank you to everyone in this thread for helping me with this by the way!
Did you install the 9-verbs template via the New Game Wizard?
Check that your Settings Manager's Camera perspective field is set to 3D, and that your Hotspots are on the Default layer.
@Alatriste No apologies needed, everyone is welcome to suggest advice.
Success! I changed the player camera to the "maincamera" tag.
So, now the cursor switches textures (as desired) when I hover over the hotspot. However, the interaction sequence is not prompted when I click the hotspot.
Do not change the tag of your first-person camera. That this improves things points to a wider issue in your scene.
Change it back, and - at runtime - check that the MainCamera is attached to your Player's camera. This camera should be listed as "attached" at the bottom of the MainCamera Inspector.
You can also check the current camera by enabling the AC Status box at the bottom of the Settings Manager. This will display debug information in the upper-left corner of the Game Window.
Is the Player's First Person camera being listed as "active"? Check also that the MainCamera is the only Camera that is enabled at runtime. All other cameras should be disabled - the MainCamera is the one that should be rendering.
Any screenshots you can share will help clarify the situation.
Here is an image with the hotspot hierarchy, the camera inspector, and hotspot action list.
https://postimg.cc/5QYcTPDm
The main issue is that it seems like you have changed a bunch of stuff around that shouldn't be changed and it's impossible for someone else to backtrack what you have done.
There should be no "Main Camera" Script on your First Person Camera.
Because the Main Camera "takes over" any Camera that the game uses/switches to, kind of like Cinemachine.
Also the First Person Camera should not have the MainCamera tag.
That's why i suggested doing it in a fresh First Person project/scene, which you ignored.
Start anew and do not change these things on the Player, you can copy the things in your Scene, Hotspots etc. over to the new Scene without problems.
If you need to change behaviors do it iteratively and test if everything still works when you change something on the Player, otherwise you will completely lose track of what caused the unwanted behavior.
Well, it is possible to backtrack, actually, and I've done just that!
And as of just now, the current state is:
The main camera has been restored, with the main camera tag and script.
The player camera has had the main camera tag and script removed.
And hovering over the hotspot triggers the cursor change successfully, but the hotspot does not respond to click.
https://postimg.cc/QBXKZPhs
Again, I appreciate all of the commenters here, and I was not ignoring your suggestion.
That's looking better.
One thing about your Hierarchy: you should remove your EventSystem - assuming it was auto-created by Unity when creating the UI Canvas - as AC will have its own that will be spawned in at runtime.
As for clicks: what is your Settings Manager's Input method, and what method of Input handling are you using? That is, Unity's old Input Manager, or the newer Input System? If you're using the latter, you'll also need to install AC's integration template for it.
Thank you ChrisIceBox,
I tried to add the AC Input System Integration from the New Game Wizard's templates, the check box was greyed out.
I also removed the Event System, with no noticeable changes.
Here are the Setting Manager Input Information and the New Game Wizards Templates page.
https://postimg.cc/QVmMPqK4
Thank you again for helping me with this matter.
I appreciate your diligence.
The "Active Input handling" option is a Unity project-wide property. It can be found in the Player section of Unity's Project settings window.
AC's "Input System" template will only be enabled if the Input System package is present in your project. It sounds like you're using Input Manager, in that case.
In your Settings Manager, check that both your Input method is set to Mouse And Keyboard, and that Mouse clicks have default functionality? is checked. Check also if there are any related messages being shown in the Console at runtime.
For complete context, share screenshots of your Hotspot Inspector and Settings Manager in full, as well as let me know your AC / Unity versions, and I'll see if I can spot the issue.
I installed the Unity Input System and changed the Active Input Handling to "Input System Package (New)"
I made sure that the Input method is set to Mouse and Keyboard, and that Mouse clicks have default functionality.
Here are the Setting Manager and the Hot spot Inspector
https://postimg.cc/gallery/gRHtdPt
I actually have SEVERAL error messages. I think we just found the issue(s)
PlayerPrefs Key 'AC_TWL_I_Nookomis_0' saved
Local player Adventurer found - this will override the default for the duration of scene TWL DEMO Scene
Input Action 'ToggleCursor' not found
Input Action 'DefaultInteraction' not found
Input Action 'Jump' not found
Input Action 'Icon_Use' not found
Input Action 'Icon_Talkto' not found
Input Action 'Icon_Lookat' not found
Input Action 'Icon_Pickup' not found
Input Action 'Icon_Give' not found
Input Action 'Icon_Open' not found
Input Action 'Icon_Close' not found
Input Action 'Icon_Push' not found
Input Action 'Icon_Pull' not found
Input Action 'Icon_Walkto' not found
Input Action 'ToggleRun' not found
Input Action 'CycleCursors' not found
Input Action 'CycleCursorsBack' not found
Cannot display correct Hotspot Icon alpha on Hotspot_Blueberry Bush because it has no associated Highlight object.
Input System is another layer of complexity - I would recommend leaving things as they are with Input Manager for the time being.
The issue with your Hotspot is that it has no Interactions defined - thus nothing to do when clicked.
A series of tutorials on interactivity in AC can be found here.