Forum rules - please read before posting.

Can't assign player [2D game]

Hello!

I can't seem to assign a player character. This is my first 2D game that I have ever made, so maybe that's why I am having trouble.

-I have watched the tutorial
-I looked it up online
-I updated the package

It seems like all I have to do is add a Player component and then add the object to the "player" tag. I added a rigid body and collider just in case, too. However, when I try and drag it over to the "player" slot, nothing happens.

Here is a few screenshots of the inspector.

I'm sure it's something simple, but I am not sure what else I am supposed to do. I

Comments

  • Hi, I think you just have to make sure the player character is set in the AC Game Editor Settings.

    Go to: AC Game Editor (if it's invisible to you, just go to Adventure Creator at the top -> Editors -> Game Editor). Once you have the editor go to Settings and then find Character settings section. There's a field to drag in your Player prefab.

    Also make sure that you have a PlayerStart marker in the scene. You can create it in AC Game Editor -> Scene -> Under navigation you can find PlayerStart 2D.

    Hope this helps!

  • The "player slot" you refer to is the one in the Settings Manager?

    Make sure you're assigning the Player prefab - not the scene instance. A prefab is necessary, because it will be spawned into the scene at runtime. Alternatively, you can leave this field blank and just have your Player object present in the scene file itself.

    Your character looks misconfigured, however. The sprite should be a child object (and assigned in the "sprite child" field), and not on the root object. If you wish for them to have a Rigidbody2D (this is not necessary), replace the Box Collider 2D with a Circle Collider 2D instead.

    Know that you can use the Character Wizard to have AC set up your Player for you - just drag the player's idle sprite into the scene, and then follow the instructions in the wizard. For more on this, see "The Character Wizard" chapter of the AC Manual.

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.