Forum rules - please read before posting.

Show loading screen when loading a save file & player looks at hotspot question

Hey, I'm closing in on shipping my second AC game! Couple of questions:

1: I have a loading menu that displays between scene changes (using Unity UI prefab and the AC loading bar tutorial), no problems there.

However when loading a save file the game freezes on the previous frame until the save file is loaded. Is there a way to display the loading menu when a save file is loading? I couldn't see an option in the settings manager.

2: Is there a way to extend the distance at which a 3D character turns their head to look at a hotspot (beyond the 'interactable' distance)? I'm using the direct movement method with a 'hotspot detector' floating in front of the player that allows the player to interact with hotspots when it touches one, currently the player only turns their head when the detector is touching a hotspot (i.e it's interactable)

I built my own system to handle the head turning instead but it's not as smooth as the default AC implementation so figured I'd ask just in case it's an easy tweak :)

Comments

  • However when loading a save file the game freezes on the previous frame until the save file is loaded. Is there a way to display the loading menu when a save file is loading? I couldn't see an option in the settings manager.

    Does loading the save-file invoke a change in the opened scene? Try checking Always reload scene when loading a save file?.

    Otherwise, what are your AC/Unity versions?

    Is there a way to extend the distance at which a 3D character turns their head to look at a hotspot (beyond the 'interactable' distance)?

    The automatic Hotspot head-turning requires the Hotspot Detector, so you'd need a different approach if you wanted head-turning to occur while still not close enough to be detected for interaction.

    One way you might find works is to attach a Trigger to the Player, set to detect Hotspots (given a specific Tag), and then have it run the Character: Face object Action to turn the Player to the detected object (assigned automatically as a GameObject parameter).

  • Thanks for the quick reply Chris.

    With 'always reload scene when loading a save file?' checked it seems to cause the game to drop to a black screen when loading a save file, which is better! Still no loading screen though.

    My Unity version is 2019.4.26f1 and AC version v1.75.3, I've been reluctant to update AC at this late stage in fear of breaking something.

    The trigger approach for head turning is great idea, I'll give that a go and let you know if I run into any issues.

    Thanks!

  • Are you relying on a dedicated loading screen/scene, or just a loading menu?

    If a scene, are you relying on Addressables, and is it an AC-scene?

    Are you relying on custom scripts? It'd be worth ruling out this being an earlier-version issue by testing the latest release in a backup/duplicate project, but the issue itself may just be a product of the load system itself.

    The loading progress is ultimately determine by Unity's internal loading progress of the scene, but it's not always as accurate as you might expect. Having a dedicated loading screen, with a before/after delay set, should ensure that the loading UI is always shown.

  • Looking into the solution for head lookat, I have a child object with a collider and a AC trigger script attached to my player (the player is a prefab).

    It seems you are only able to specify a tag name when the Detection method is set to Rigidbody Collision. Does this mean I would need to add a rigidbody to all of my hotspots?

    I also have the hotspot layers switching to 'Ignore Raycast' when they're disabled by AC so I guess that would need to factor into the logic somewhere?

    Possibly stretching AC's core functionality a bit thin here! Maybe I can use my own raycasting detection method and tap into the actionlist asset parameter to set the head look at target and call the Character: face object function to handle the actual head movement.

  • Are you relying on a dedicated loading screen/scene, or just a loading menu?

    I'm using a loading menu, not a scene. I use a few custom actions and scripts to help link AC and Playmaker.

    I'll look into using a loading scene and see if this helps resolve the issue. Just having the visual feedback of the game dropping to a black screen when clicking a save file to load is a lot better than it hanging on the previous frame as it was before. So not the end of the world.

  • Sorry for the barrage of messages, just wanted to let you know I have the head turning working great now.

    I used my existing playmaker logic for finding the target, then used the script you provided in the link below to set the actionlist parameter and use the AC Character: Face object action.

    https://adventurecreator.org/forum/discussion/10810/gameobject-as-a-global-variable

  • edited July 2024

    Last update, I unticked 'Load when click on?' in my load saves list and am now using an actionlist with a parameter for the slot index. This way I can fade out audio and fade in a (static) loading UI before loading the actual save. I then turn off this menu in each of my scenes 'onLoad' actionlists.

    It's a much more polished solution than what I had before. Thanks for your help Chris, consider this one resolved :)

  • Nice one, thanks for the update. In answer to your eariler post:

    It seems you are only able to specify a tag name when the Detection method is set to Rigidbody Collision. Does this mean I would need to add a rigidbody to all of my hotspots?

    A Rigidbody is only necessary on either the Trigger, or the objects it is intended to detect. A Rigidbody with "Is Kinematic" checked, attached to the Trigger, should be enough.

    I also have the hotspot layers switching to 'Ignore Raycast' when they're disabled by AC so I guess that would need to factor into the logic somewhere?

    If you check Place distant Hotspots in separate layer?, Hotspots outside of the detector will be placed on the 'DistantHotspot' layer instead.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.