Forum rules - please read before posting.

Issue with the "Recreating Unity's adventure game" tutorial

Hi,

I am currently trying to get the "Recreating Unity's adventure game" tutorial to work and having an issue when creating the player. I'm following the tutorial step by step as exactly as possible, but when I generate the scene structure for the security room (around 18:00 into the video), the game will not create a player start. This I could fix by manually creating one. But then, when I start the game, the character will fall through the floor. I tried to google the problem but the only "solution" I could find was to disable gravity in the physics settings of the player, which didn't seem like a real solution to me.

I am currently using:
Unity 2018.3.0f2
AC 1.65.2
Sample Game 1.7

I hope, somebody can help me :)

Best regards

Comments

  • Welcome to the community, @Thousand.

    Was a PlayerStart added to the scene Hierarchy, but not assigned as the "default" in the Scene Manager, or was none added at all? Does the same occur if you try in a fresh scene?

    If the Player is falling through the floor, then there'll be an issue with the physics in the scene. AC isn't overriding Unity's physics system, so as long as the colliders / Rigidbody components are correct then you should be OK.

    The "floor" collider of the scene is the "Mesh Collider" placed on the root "SecurityRoom" object. Is that enabled and correct?

    Since the floor in the two scenes is the same height throughout, there's not actually any need for the physics system at all. You can remove the Rigibody and Capsule Collider components from the Player - and also replace them with a Character Controller if you prefer.

  • Thank you for the welcome and your answer :)

    The PlayerStart was not created in the scene and therefore not assigned. I used the "Create" Button for the Default PlayerStart in the Scene manager to make a new one. Also I just tested it in an empty scene and there it works.

    Regarding the floor: I double checked and both the security room and the market have their mesh colliders defined and enabled. I did deactivate gravity in the Player script so I could go on with the tutorial and that worked, because, as you said, it's the same height everywhere. But for a "real" project that might not be an ideal solution.

    Also, I'm not sure it's relevant or even related, but I also had the ActionList creation problem described in this post: https://adventurecreator.org/forum/discussion/8204/action-list-creation-problem
    But changing ActionListAsset.cs:263 as described there did the trick for me.

    The more I try around the more it seems that the latest versions of Unity and/or the Sample game somehow don't work along as well with AC anymore since you recorded the video but I can't really tell why. Maybe you have more luck with it ;)

    Thanks again and a happy new year

  • I did deactivate gravity in the Player script so I could go on with the tutorial and that worked, because, as you said, it's the same height everywhere. But for a "real" project that might not be an ideal solution.

    If you find the same issue in another project, let me know and we'll look into it.

    But changing ActionListAsset.cs:263 as described there did the trick for me.

    Good. This change will be applied as part of the next official update.

    The more I try around the more it seems that the latest versions of Unity and/or the Sample game somehow don't work along as well with AC anymore since you recorded the video but I can't really tell why.

    Certainly, you should try to use the same version of Unity that the tutorial was recorded with - however the general AC workflow should still be the same. If you encounter any other issues, just reply here to this thread and we'll see what can be done.

  • So, I tried around a little bit more and found out, that the "culprit" was the isTrigger checkbox in the capsule collider of the player prefab. Which is kind of understandable on one hand, but a little bit weird on the other hand. Because in the video, you set this to true at 13:40, so why was it working in the video?

    Well, at least I learned a lot and know what to look out, if I encounter a similar problem in the future :)

  • Because in the video, you set this to true at 13:40, so why was it working in the video?

    Good question! Perhaps a Unity bug cancelled out my mistake. I'll see if I can work out what went on there.

  • Hi Chris, It's been a while since I last posted anything. I have same question/issue. I've actually been through the tutorial "Recreating Adventure Game" before and believe I posted a similar question, only to resolve the falling through floor by unchecking "Is Trigger". What's curious to me is that the explanation for why to enable Is Trigger, states that enabling is required so that the collider is used purely for triggers and not collision. With Is Trigger (checked) enabled, player falls through floor, unchecked, player behaves as expected but also, the hotspot/trigger still works when moving from the Market to the Security Room scenes. My thought was that "Is Trigger" must be checked for hotspots/triggers to work? Could you shed light on this puzzle? I hope to fully understand this as I am building an scene using Unity terrain and mesh collider pathfinding and experience the same falling through issue unless "Is Trigger" is left unchecked. I've tried variations of the scene setup using Unity Navigation as pathfinding instead of Mesh Collider with same outcomes, player falls through unless Is Trigger on player prefab unchecked.

    I always appreciate your asset, it's the best for my needs. I'm slow at this but feel I am finally acquiring usable knowledge and that would not happen without AC. Thanks Chris, look forward to your reply.

    Tom

  • Forgot to mention, I’m running AC 1.72.4 and Unity 2019.17f1LTS.
  • Hotspots do not require Is Trigger to work, but it's often the case that you don't want them to provide collisions.

    Triggers to requires Is Trigger to work, since you need characters to be able to pass inside them.

    Unity Navigation would be more appropriate when Terrain is involved, but either way: "Is Trigger" will cause collisions to be ignored. If your Player relies on gravity, then they'll fall through the floor if this is checked, unless there is a separate collider with Is Trigger unchecked to act as the floor.

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.